• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Quantitative Interview questions and answers

5. A unit length is broken off into 3 pieces. What is the probability of them forming a triangle ?
Answer
: 1/8 or 12.5%

Actually, the answer here is \(\frac{1}{4}\). It's easy to only consider half the possibilities when you work this one.

As Andy has said, this basically amounts to asking the question: Pick two points on the interval (0,1); what's the probability that none of the three resulting intervals is longer than \(\frac{1}{2}\)?

Consider first the circumstance where the first point--\(x_1\)--is on the interval \((0,\frac{1}{2})\). Where can we place the second point in order to make the desired result happen?

It's fairly clear that the interval \((\frac{1}{2}, x_1 + \frac{1}{2})\) is the answer to that question. This interval has length \(x_1\). Thus, the probability of success, given \(x_1 < \frac{1}{2}\), is \(x_1\), since our second cut is uniformly distributed on (0,1).

The probability of success overall, then, is the integral of this probability over all choices of \(x_1 < \frac{1}{2}\):
\(\int_0^{\frac{1}{2}}x_1dx_1 = \frac{1}{2}(\frac{1}{4}-0) = \frac{1}{8}\)

But remember that we started the problem under the constraint \(x_1 < \frac{1}{2}\). Clearly, the problem is symmetric, so the probability of success with \(x_1 > \frac{1}{2}\) is the same again--\(\frac{1}{8}\).

Altogether, then, the probability of success is \(\frac{1}{4}\).
 
Aha...looks like I'm going 0/2 this round :D

Thanks for the complete explaination, Bob. Given that you have your fair shares dealing with these kind of problems, everyone can benefit if you can kindly post similar brainteasers/quizzes here. The only requirement is that they can be solved in less than 5 minutes without a calculator ;)

Here is another question needs answer:

8. There are 100 identical looking balls, 50 red, 50 blue. How would you put them into 2 jars so that if you randomly pick one ball out of these 2 jars, the probability of picking red ball is larger than blue.
 
One more question looking for answer:

A man speaks the truth 3 out of 4 times. He throws a die and reports it to be a 6. What is the probability of it being a 6?
Nifty question. My gut was to say that the answer here is \(\frac{1}{4}\), since we're conditioning on the report of the roll, which gives us more information to work with. A closer look shows that this is a reasonable answer to the question, but not the only possible one....

This is actually a conditional probability:

\(P(rolls 6 | reports 6) = \frac{P(rolls 6, reports 6)}{P(reports 6)}\)

Here's where the assumptions begin to come in. For one thing, we assume that the roll and the decision to lie are independent; under this assumption, the numerator is easy:

\(P(rolls 6, reports 6) = P(rolls 6, tells the truth) = \frac{1}{6}*\frac{1}{4} = \frac{1}{24}\)

The denominator is trickier. This is where the biggest assumptions come in.

\(P(reports 6) = P(rolls 6, tells the truth) + P(rolls non-6, lies, reports 6)\)

We've already computed the first term, but how do we compute the second? We have to know something about how the person lies.

Are the person's lies always plausible? (That is, would the person lie by saying a 3.4 had been rolled, or a 529?) Given that they're always plausible, are they "fair?" (That is, is the person's lying strategy to choose a plausible lie at random with an equal probability of each lie, or is there some other distribution to the lies? Is the lie even random, aside from the initial throw of the die?)

For the sake of convenience, let's assume that, when the person lies, he or she does so by reporting some other plausible result at random, with equal probability of each lie. Then:

\(P(reports 6) = \frac{1}{24} + \frac{5}{6}*\frac{3}{4}*\frac{1}{5}=\frac{1}{24}+\frac{1}{8}=\frac{1}{6}\)

Overall, then:
\(P(rolls 6 | reports 6) = \frac{\frac{1}{24}}{\frac{1}{6}} = \frac{1}{4}\), as expected.

For the sake of illustration, though, let's work the problem under a different lying strategy: suppose the person always says "6" when lying about a non-6. (We don't really care what he does when lying about a 6.) Then:

\(P(reports 6) = \frac{1}{24} + \frac{5}{6}*\frac{3}{4}*1 = \frac{1}{24} + \frac{5}{8} = \frac{2}{3}\)

Under this alternative assumption:

\(P(rolls 6 | reports 6) = \frac{\frac{1}{24}}{\frac{2}{3}} = \frac{1}{16}\)

As you can see, how you assume the person lies can have a rather dramatic impact on the answer....
 
Aha...looks like I'm going 0/2 this round :D

Thanks for the complete explaination, Bob. Given that you have your fair shares dealing with these kind of problems, everyone can benefit if you can kindly post similar brainteasers/quizzes here. The only requirement is that they can be solved in less than 5 minutes without a calculator ;)

Here is another question needs answer:

8. There are 100 identical looking balls, 50 red, 50 blue. How would you put them into 2 jars so that if you randomly pick one ball out of these 2 jars, the probability of picking red ball is larger than blue.
I've seen this question before. I assume the way we "randomly pick one ball out of these 2 jars" is first to select a jar at random, then select a ball at random from that jar.

In this case, you can get pretty close to making the probability of selecting a red ball \(\frac{3}{4}\): Put a single red ball in one of the jars; put all the rest of the balls in the other jar. Then there's a \(\frac{1}{2}\) probability of getting a red ball just by selecting the jar, then a probability of \(\frac{49}{99}\)--nearly a half--of selecting a red ball even if you choose the other one.

A related question: How do we minimize the probability of selecting a red ball?
 
Two fun ones that are both pretty doable:

1. An airplane has N seats, and N passengers are waiting to board it, not in any particular order. Miraculously, everyone is assigned to a different seat on the airplane; however, the first passenger to board is a jerk and selects a seat at random. Thereafter, passengers board one at a time according to the following rule: If his or her assigned seat is vacant, the passenger sits there; otherwise, the passenger selects a vacant seat at random.

What's the probability that the last passenger to board gets his or her assigned seat?

2. We have two concentric circles. A chord of the larger circle is tangent to the smaller circle and has length 8. What's the area of the annulus--the region between the two circles?
 
In this case, you can get pretty close to making the probability of selecting a red ball \(\frac{3}{4}\)
How you come up with 3/4, Bob ?
A related question: How do we minimize the probability of selecting a red ball?
Probably the same idea of maximizing red chance: by put one blue in one jar and the rest in the other jar ? then the probability of getting a red is 50/99, a bit more than half but less than 3/4. If I need to do better than that, then I first need to understand why you get 3/4 :)
1. An airplane has N seats, and N passengers are waiting to board it, not in any particular order. Miraculously, everyone is assigned to a different seat on the airplane; however, the first passenger to board is a jerk and selects a seat at random. Thereafter, passengers board one at a time according to the following rule: If his or her assigned seat is vacant, the passenger sits there; otherwise, the passenger selects a vacant seat at random.

What's the probability that the last passenger to board gets his or her assigned seat?
this sounds similar like asking what is the chance of that jerk randomly selects his assigned seat which is \(\frac{1}{N}\). Once passenger nth where 1 < n < N got his assigned seat, the rest of them will get their assigned seats.
That the jerk who matters ;)
2. We have two concentric circles. A chord of the larger circle is tangent to the smaller circle and has length 8. What's the area of the annulus--the region between the two circles?
The area of the annulus is \(16 \pi \) same as of the smaller circle.
 
Andy said:
How you come up with 3/4, Bob ?

Probably the same idea of maximizing red chance: by put one blue in one jar and the rest in the other jar ? then the probability of getting a red is 50/99, a bit more than half but less than 3/4. If I need to do better than that, then I first need to understand why you get 3/4 :)

If we select a jar first at random, then the probability that we select the jar containing only a red marble is 1/2. We will certainly draw red when we draw from this jar. Otherwise (probability 1/2), we select at random from the other jar, in which we have a probability of 49/99 of selecting a red marble. So:

\(P(red) = \frac{1}{2}*1 + \frac{1}{2}*\frac{49}{99} \approx \frac{1}{2} + \frac{1}{2}*\frac{1}{2} = \frac{1}{2} + \frac{1}{4} = \frac{3}{4}\)

If you're allowed to keep one jar empty, then the way you minimize the probability of choosing a red is to put all the marbles in one jar. Under those circumstances, the probability is \(\frac{1}{4}\). If you're not allowed to have an empty jar, then the solution is as you suggest, and the probability is just a shade higher than that.
 
this sounds similar like asking what is the chance of that jerk randomly selects his assigned seat which is \(\frac{1}{N}\). Once passenger nth where 1 < n < N got his assigned seat, the rest of them will get their assigned seats.
That the jerk who matters ;)

The area of the annulus is \(16 \pi \) same as of the smaller circle.

You don't have the right answer to the airplane question.

As to the annulus question, your answer is correct--it's \(16\pi\)--but the reasoning is not. In fact, one of the interesting things about this problem is that you can determine the area of the annulus, but not the radii of either circle: For any inner circle you choose, there's an outer circle that has a chord of length 8 tangent to the inner circle.
 
If you're allowed to keep one jar empty, then the way you minimize the probability of choosing a red is to put all the marbles in one jar. Under those circumstances, the probability is (\frac{1}{4}). If you're not allowed to have an empty jar, then the solution is as you suggest, and the probability is just a shade higher than that.
I see, I was aiming for the exact 3/4 ...:wall
So if empty jar is not allowed, I had 25/99 a bit better than 1/4 as you said.

Related question: what if we have x red balls and y blue balls. There should be a generalized method involving solving system of equations ?
You don't have the right answer to the airplane question.
Gotta work some more on it.
As to the annulus question, your answer is correct--it's (16\pi)--but the reasoning is not. In fact, one of the interesting things about this problem is that you can determine the area of the annulus, but not the radii of either circle: For any inner circle you choose, there's an outer circle that has a chord of length 8 tangent to the inner circle.
Shooo. Probably we can find the ratio of radii but not the exact radii.
 
2. We have two concentric circles. A chord of the larger circle is tangent to the smaller circle and has length 8. What's the area of the annulus--the region between the two circles?


Well if the answer is \(16 \pi\) isn't is just pythagoras theorem -- and indeed you cannot find the radii of either circle....

an interesting extension though might be to find the area of the annulus on the side of the division containing the smaller circle -- though my feeling is you will need more information to solve for that......
 
7. There are 14 identical-looking balls. 13 of them have the same weight while one of them is heavier than the rest. What is the minimum times you can weight to identify the heaviest ball ? How do you generalize for n balls ?
Answer
: With 3 weights, I can identify the heaviest ball. For n balls, I can identify the heaviest ball after x times where x is the largest integer such that \(2^x \leq n\)
I remember seeing this problem in an old Math Olympiad ('80s). The original problem was to find a false coin among 12 coins using a two dish weight scale. The false coin could be either heavier or lighter.
I think the reasoning is similar. There is an algorithm to find the solution. The premise of the algorithm is the following: if a coin goes up in one weigh and down in another, that coin is not false.
 
1. An airplane has N seats, and N passengers are waiting to board it, not in any particular order. Miraculously, everyone is assigned to a different seat on the airplane; however, the first passenger to board is a jerk and selects a seat at random. Thereafter, passengers board one at a time according to the following rule: If his or her assigned seat is vacant, the passenger sits there; otherwise, the passenger selects a vacant seat at random.

What's the probability that the last passenger to board gets his or her assigned seat?

Is the answer \( \frac{N-1}{N} \)

Here is how I approached the problem :--
Let P(N) be the probablity of success when we have N passengers...... Now we have 2 cases :-
1) the first passenger sits on his seat happens with a probability \( \frac{1}{N} \) ----- in this case everybody else will sit on his seat and hence the probability of success will be 1.
2) the first passenger DOES NOT sit in his seat happens with a probability \( \frac{N-1}{N} \) --- he sits on the seat of a person we can call person 2... Now when this person comes in its like he is the first one in, and he is sitting at random .... So we come up with a recurrence relationship like

\( P(N) = \frac{1}{N} + \frac{N-1}{N} P(N-1) \)
With a little bit of algebra it transforms to
\( P(N) = \frac{k}{N} + \frac{N-k}{N} P(N-k) \)

We have the boundary condition P(2) = 1/2 .... subistuting for P(2) and k=n-2 we get \( P(N) = \frac{N-1}{N} \)
 
I'm pretty sure the correct answer to this one should be \(\frac{3}{4}\).

EDIT:
...but it isn't.
I'm still not sure why, but a quick MC simulation has convinced me that I'm missing something here. I'll take a look at it again when my brain's working a little better.

It turns out that I was wrong...about being wrong. The MC simulation was the part that wasn't correct; my original reasoning was fine. The answer to this one is in fact \(\frac{3}{4}\).

We pick the first point at random, but it's really arbitrary. We can always rotate the circle and make \(\theta_1=0\).

Now choose the second point, and call the length of the minor arc between the first point and it \(\alpha\). Now, clearly \(\alpha\epsilon(0,\pi)\) and is uniformly distributed. That is, \(P(\alpha=A) = \frac{1}{\pi} \forall A\epsilon(0,\pi)\).

If you draw yourself a picture, you can see that the length of the arc where \(\theta_3\) can fall in order for all three points to be on the same semicircle is \(2\pi-\alpha\). Since \(\theta_3\) is uniformly distributed, the probability of success given \(\alpha\) will be \(\frac{2\pi-\alpha}{2\pi}=1-\frac{\alpha}{2\pi}\).

To find the total probability of success, we integrate:
\(\int1-\frac{\alpha}{2\pi}dP_\alpha=\int_0^\pi(1-\frac{\alpha}{2\pi})\frac{1}{\pi}d\alpha\)

The result of this integral is \(\frac{3}{4}\).
 
airplane seats

I believe the answer is 1/2. If the first person selects his own seat then everyone else sits in theirs and nth person thus gets their own seat. If the first person sits in seat n, then everyone else gets their own seat except the nth person (he/she inherits the first person's seat).

Along these lines, if the first person sits in seat x E{1,2,...n} then everyone up to person x sits in their own seat. If x then sits in seat 1, then everyone after x sits in their own seats and the nth person gets the nth seat. However, if x sits in seat 1, then everyone after x gets their own seat except for the nth person. He again inherits seat 1. Finally, if x sits in some other seat, say seat y where y>x, then everyone up until person y gets their own seat and we start this logic all over again for person y(choosing either seat 1 or seat n).

In all cases, the final person (person n) will get either their seat or seat 1. Try a permutation with 5 people.... Not sure mathematically how to approach, only logically. Any mathematical proofs of this would be nice :)

-JK
 
I believe the answer is 1/2. If the first person selects his own seat then everyone else sits in theirs and nth person thus gets their own seat. If the first person sits in seat n, then everyone else gets their own seat except the nth person (he/she inherits the first person's seat).

Along these lines, if the first person sits in seat x E{1,2,...n} then everyone up to person x sits in their own seat. If x then sits in seat 1, then everyone after x sits in their own seats and the nth person gets the nth seat. However, if x sits in seat 1, then everyone after x gets their own seat except for the nth person. He again inherits seat 1. Finally, if x sits in some other seat, say seat y where y>x, then everyone up until person y gets their own seat and we start this logic all over again for person y(choosing either seat 1 or seat n).

In all cases, the final person (person n) will get either their seat or seat 1. Try a permutation with 5 people.... Not sure mathematically how to approach, only logically. Any mathematical proofs of this would be nice :)

-JK
1/2 is correct, and your reasoning sounds pretty good to me. What makes it work is that there are only two ways the outcome can be finally decided: by someone randomly choosing the jerk's seat, or else randomly choosing the last passenger's seat. The likelihood of these two outcomes is the same at every stage of the process; the first leads to the passenger definitely getting his/her own seat, the second leads to the passenger definitely not getting his/her own seat.

You could dress the reasoning up with a proof by induction (show that it's 1/2 in the case N=2, then show that if it's 1/2 in the N-case, then it must be 1/2 in the N+1-case), but you have the kernel of why the answer is what it is.
 
Here a few more fun and worth doing problems.

Question: Given arbitrary integer, come up with a rule to judge if it is divisible by 9. Prove it.

Question: Roll a penny around another fixed penny in the center with edges in close contact. After moving half circle around the center penny, you will find the penny in motion has rotated 360 deg. Why?

Question: very heavy wall moving at 60mph, a ball moving same direction at 120 mph. What is direction and speed of ball after ball hit wall.

Question: A square with four corners A,B,C,D. Suppose you start from corner A and have equal chance to go to neighboring corners B and D; After reaching new corner, you again have equal chance to go to its two neighboring corners. The time consumed to travel on each edge is 1, what is the mean time to come back to A.

Question: What is the properties of (p^2-1) where p is prime number larger than 3

Question: A stair of 100 steps. You can either climb either one step or two steps but no more each time and you can walk up entire stair any way you like with rule above obeyed. How many possible combinations of ways to finish the walk?

Question: Given variances and covariance of X and Y. Z=a*X+b*Y. Calc variance of Z.
 
Question: very heavy wall moving at 60mph, a ball moving same direction at 120 mph. What is direction and speed of ball after ball hit wall.

Is the answer the ball stops?

Well lets change the reference plane, and sit on the wall....

In the reference plane of the wall, just before impact the ball was travelling towards it with a speed 60mph...

Assume no energy gets lost.... Also we are given that the wall is very heavy, and therefore it will not move as a result of this impact.... Since the wall does not move, and we need to conserve energy, the ball must be moving away from the wall, at the same speed at which it was approaching it...

ie in the reference of the wall the ball is moving away at 60 mph...

But the wall itself is moving at 60 mph wrt to the reference observor.... so the ball must be stationary with respect to the reference observor...
 
Here a few more fun and worth doing problems.

Question: Given arbitrary integer, come up with a rule to judge if it is divisible by 9. Prove it.

I am sure the rule says that the if the digits of the number are dn dn-1 d1 d0 then the sum of the digits must be divisible by 9....

Here is an attempt at the proof :--

Number is dn dn-1 d1 d0 where each of d0 - d9 is between 0 and 9
number = d0 + 10*d1 + 100*d2 + 1000*d3 + .....
= (d0+ d1 + d2 + d3 + .....) + 9 d1 + 99d2 + 999 d3 + ..........
= (sum of the digits) + 9 (d1 + 11d2 + 111d3 + ......)

Now the second term above is divisible by 9, and for the complete number to be divisible by 9 the sum of digits must be divisible by 9...

I guess the same proof works for divisibility by 3....
 
Is the answer the ball stops?
This reminds me of Physics 101 where we learn about velocity, relative speed, momentum. Before hitting the wall, the ball moves at 60mph relative to the wall. After hitting, it moves back with -60mph relative to the wall so the ball will stay still relative to the wall.

As you pointed out, SP, it depends on the reference point. If you sit on the wall or move with the speed of the wall, the ball will stop relative to you. If you stands on the ground, the ball will move with the same speed and direction as the wall i.e 60mph in the same direction as before.

I don't have answers to any of these questions but I believe this is the correct answer for this specific question.
 
Back
Top