We have started collecting interview questions in quantitative finance. Your contributions are most welcome. Please send them to info which, as usual, happens to be at thalesians.com.
Note: Although many of these questions are really basic, they may still be asked at interviews.
- In your bedroom you have a drawer with 2 red, 4 yellow, 6 purple, 8 brown, 10 white, 12 green, 14 black, 16 blue, 18 gray, and 20 orange socks. It is dark, so you cannot distinguish between the colours of the socks. How many socks do you need to take out of the drawer to be sure that you have at least three pairs of socks of the same colour?
- Don't use probabilities, expectations, etc.!
- 47 socks.
- In the worst case you didn't take three pairs of socks of the same colour; you took 2 red socks, 4 yellow socks, 5 purple socks, 5 brown socks, 5 white socks, 5 green socks, 5 black socks, 5 blue socks, 5 gray socks, and 5 orange socks (that's 46 socks in total). Then if you take one more sock, you are sure to have at least three pairs of socks of the same colour. Thus you need to take 47 socks out of the drawer.
- You are given two ropes and a lighter. Each of the two ropes has the following property: if you light one end of the rope, it will take exactly one hour to burn all the way to the other end. However, it won't necessarily burn at a uniform rate: e.g. half the rope may burn in the first five minutes while the remaining half would take 55 minutes. The two ropes won't necessarily be burning at the same rate at any given time (but both take one hour to burn completely). Given this equipment and nothing else you are asked to measure a period of 45 minutes. How will you do it?
- Light both ends of rope A and one end of rope B. After 30 minutes rope A will be completely burned up and there will be 30 minutes of rope B left. Light the other end of rope B. It will burn up in 15 minutes. The total time elapsed will be 45 minutes.
- Show that for any positive integer n there is a sequence of n consecutive positive integers none of which is prime.
- Hint 1
- Think of Euclid's famous proof that there are infinitely many primes.
- Hint 2
- Use factorials.
- Consider the sequence
- 2 divides the first term, 3 divides the second term, ..., n + 1 divides the nth term. Thus none of these positive integers is prime.
- You have a rectangular chocolate bar, m by n tiles. You start breaking the chocolate bar, always along the lines, until you end up with mn pieces (i.e. all the tiles have been separated). You want to minimise the number of breaks. What's the best strategy?
- It doesn't really matter what you do. You'll always have to break the chocolate bar mn − 1 times.
- Solution 1 ("Topological")
- After you have made k breaks, you always end up with k + 1 pieces (think about it): there is one piece (i.e. the chocolate bar) originally; then after one break there are two pieces; after two breaks there are three pieces, etc. As there are mn pieces, you'll need mn − 1 breaks.
- Solution 2 (Induction)
- Let N = mn be the size of the chocolate bar (i.e. the number of tiles in it). Our induction hypothesis is that a chocolate bar of size N requires N − 1 breaks to split it into individual tiles. The base cases for N − 1 and N − 2 are obvious (for N = 1 we have a tile already, so no breaks are required; for N = 2 we always have one break to make — no choices required here). Let's prove that a chocolate bar of size N + 1 requires N breaks. Let a,b be the tile dimensions of this chocolate bar so that ab = N + 1. Depending on where we break the bar we end up with two pieces: either or , so that , . We then need to split the resulting two pieces. Since both their sizes are less than or equal to N, we can apply the induction hypothesis to each. In the first case we have (jb − 1) + ((a − j)b − 1) = ab − 2 breaks to make. In the second case we have (ak − 1) + (a(b − k) − 1) = ab − 2 breaks to make. Adding the initial break, we always have to make ab − 1 = N breaks. The result follows by induction.
- Note that Solution 2 is much more long-winded than Solution 1. There is probably more merit in spotting Solution 1, although Solution 1 is more "formal".
- Prove that π > 3.
- Consider a regular hexagon inscribed in a circle of circumference C and radius r. The perimeter P of the regular hexagon is 6r. The straight sides of the hexagon are shorter than the curved arcs of the circle, so C > P. But C = 2πr, P = 6r, so π > 3.
- Prove that .
- Sketch the graphs of (a) sin(1 / x), (b) xsin(1 / x).
Probability and statistics
- You have a bowl of spaghetti. You pick up a random end of a spaghetto (I believe that's singular for spaghetti) with your left hand and another random end with your right hand and tie them together, then repeat this procedure while there are still free ends. What is the expected number of spaghetti cycles that you get as a result?
- The examiner has estimated that a student will solve a certain problem with probability 60% if that student has never seen the problem before. He will solve it with probability 95% if he has already seen it. The examiner believes that 30% of his students would have seen the problem before. Given that a particular student solves the problem correctly, what is the probability that this student has seen the problem before?
- A straightforward application of Bayes's theorem.
- Let C be the event "student gives correct answer" and S be the event "student seen problem before".
- Then P(C | S) = 0.95, , P(S) = 0.3 (so ).
- up from P(S) = 0.3.
- Buffon's Needle, a problem due to Comte de Buffon (1707-1788). Consider a plane, ruled with equidistant parralel lines, where the distance between the lines is D. A needle of length L < D is tossed onto the plane. What is the probability that the needle intersects one or more lines? How can you use this arrangement to estimate π?
- Courtesy of David Foster, Oleg Kovrizhkin and Jiri Moudry. A student calls out an answer to a multiple choice question at random, A, B, C or D, until he is correct (say the correct answer is A). On average, how many times will he have to do this?
- 4 times
- Let X be the random variable that gives the number of trials up to and including the successful trial. So for the sequence "BCBDA" the value is 5. Then
- where θ is the probability of calling out the right answer at random, which is in our case. We need to compute the expectation
- Now we observe that , so
- We can interchange the summation and differentiation (a useful trick!) to get
- This leaves us with a geometric series , so
- As , we get .
- Note: we have computed the mean of a special case of the negative binomial distribution, which arises as the number of failures of Bernoulli trials needed to get a specified (non-random) number of successes. Pascal distribution and Polya distribution are special cases of the negative binomial.
- Courtesy of David Foster. What is the expected number of tosses of a fair coin before you see the sequence THTT?
- Write a function that will randomly shuffle an array of n integers.
- How would you generate a list of all 10 by 10 matrices whose entries are integers from 0 to 9?
- Write down the prototypes of the main function.
- Although this question is extremely elementary, we have heard it asked in interviews to determine whether the interviewee knows some of the elementary definitions from the C++ standard. Then the interviewer may ask some further questions on the prototypes.
- The two possible prototypes are:
- int main(void);
- int main(int argc, char * argv);
- The return type of main must be int. main may not be called from inside the program, only the system may call the main function. main may not be declared inline nor static.
- There are several unusual things about main. Its return type may be omitted (but int is still implied). main doesn't have to explicitly return a value. If this were any other function, there would be a compile error.
- According to the C++ Standard, "it is implementation-defined whether a program in a freestanding environment is required to define a main function".
- Explain the differences between std::vector and std::list. Under what circumstances is the former (latter) preferable?
- What is the "dreaded diamond"?
- Given a linked list, what methods can you use to determine whether it is circular? What are the trade-offs?
- What exactly is understood by "sticky strike", "sticky delta" and "sticky moneyness"?
- There are two different conventions for quoting deltas: "spot delta" and "forward delta". Explain the difference between them. Why do we need two different conventions?
- In relation to the volatility smile, what exactly is represented by (a) the risk reversals, (b) the strangles? What happens to the smile as (a) the risk reversals, (b) the strangles are increased? (Sketch the graphs.)
- In relation to implied volatility quotes, what is meant by the "weekend effect"?
- You have a sequence of volatility smiles for different tenors (for example, ON, 1W, 2W, 1M, 3M, 6M, 1Y, 2Y) each specified as five points (ATM, RR10, RR25, STR10, STR25). What methods could you use to interpolate the volatility surface? How would you take care of the weekend and holiday effects?
- How would you price a correlation swap?
- How would you price an Asian option? The model is Black-Scholes. Can you derive the pricing formula?
- This page was last modified on 1 February 2011, at 12:22.
- This page has been accessed 151,033 times.