"Senior software engineers are the most experienced member of a software team and usually carry the most responsibility and authority of that team. Because of this, interviews will be designed to find candidates who have expert knowledge of the field and years of experience as a software engineer. Expect to be asked tough technical questions and to give examples of previous projects that you have worked on."
We have m slots for ads and n ads, each ads will have different revenue on differnet slot, design an algorithm to find out the best fit (find m ads in n ads and order them so that they can make max money, white board coding) .
It's a standard bipartite matching problem, aka assignment problem. Solutions are standard as well, but none of them are easy. They cannot be figured out during the interview, you just have to know them. These types of questions just make me wonder about those who ask those questions. What exactly do they test? How long have you been from college where you studied Ford-Fulkerson maximum flow algorithm, or Hungarian algorithm (both applicable to the problem)? Show me an interviewer who can answer this question, unless he or she specially prepared it for an interview, thus wasting his productive time at work? And, by the way, trying to use textbook algorithms for real life assignment problems would lead to the results that are mediocre at best. Commercial-strength packages have lots of optimizations for special cases of input data. For instance, the Linux qsort command uses 3 different sorting algorithms depending on the size of input data.
maybe the interviewers just want to test whether you realize (in reasonable) time that this is a non-trivial problem to solve.
If one add can go into multiple slots then this is a simple problem. For every slot you can check which add gives maximum revenue. It is of order (m*n). Then how many adds can one slot take? If one slot can take as many adds as possible then you can put all the adds into most profitable slots leaving some empty. Again a simple solution. If an add can only go into one slot and each slot can take only one add (m>=n), then it is a complicated problem. May be interviewer wants to see if you can separate those cases.