In my book I provide many examples of interview questions: informational, technical and case questions that you are likely to encounter at quant interviews.
The following is a really good hybrid technical-cum-case question that I myself was asked when I interviewed for my present full-time financial engineer job. It’s a technical question because it tests whether you know what a median is, how to find the median, and how you would do it via a computer program. It’s also a case question because it involves some serious problem-solving skills — it’s not a trivial technical question but requires some degree of out-of-box thinking. Chapter 4 of my book reveals the exact steps you can take to approaching a question like this.
I won’t disclose the answer, of which there are two approaches, today, because I want you to work it out yourself.
Question: You are given a sample of 10 trillion unsorted numbers. You have an ordinary PC with limited CPU power and memory, but a big enough hard disk to hold the data (plus to cache any necessary calculations). Now, how can you find the median of these 10 trillions numbers quickly? (By "quickly" I mean within a reasonable amount of time.)
Analysis: Usually, finding the exact median of a series of numbers requires sorting the series and then picking out the middle guy. But, alas, it’s pretty much impossible to sort 10 trillion numbers, no matter which sorting algorithm you use. So, how can you solve this problem?
Hint: Is it really necessary to find the exact median? If not, what would you do? But if yes, what would you do then?
Note: This question can definitely be solved, i.e., it has a real, non-trivial answer.
If you think you have the answer, feel free to e-mail it to me and I’ll let you know if you got it right.