
Quant Interview Question - Jane Street
Quantitative finance interviews, especially at top firms like Jane Street, are renowned for their challenging and thought-provoking puzzles. These questions are not just about testing mathematical prowess but also creativity, logical thinking, and the ability to break down complex problems. In this article, we’ll deeply explore two such classic quant interview questions. We’ll break down each step, clarify the underlying concepts, and explain why these questions are favorites among quantitative trading firms.
Quant Interview Question 1: The Three-Legged Table on a Round Disk
Problem Statement
Suppose you have a perfectly round disk. You attach three legs to this disk, placing each leg at a random point along the circumference. The legs are perfectly perpendicular to the disk and are attached firmly. If you flip the disk and let it stand on its legs, what is the probability that the table will be stable (i.e., will not fall over)? In other words, what is the probability that when you set the table down on the three legs, it will stand upright without tipping?
Breaking Down the Problem
This is a classic geometric probability problem. Let's understand each part:
- Disk: Perfectly round, so we’re dealing with a circle in two dimensions.
- Three legs: Each is placed randomly on the circumference.
- Legs are perpendicular: No wobbling due to crooked legs.
- Stability: The table stands if, when flipped, the center of mass (the disk’s center) is above the triangle formed by the legs.
Visualizing the Situation
After attaching the legs, if you flip the disk and put it down, the table will stand if the center of the disk lies within the triangle formed by the three legs. If the center is outside this triangle, the table will tip.
Key Concepts Involved
- Random Points on a Circle: The probability is evaluated over all possible ways three points can be chosen on a circle.
- Triangle Contains Center: The table stands if and only if the triangle formed by the three legs contains the disk’s center.
- Symmetry: The symmetry of the circle simplifies the probability calculation.
Mathematical Formalization
Let’s define the steps to calculate the probability that the center is inside the triangle formed by three random points on a circle.
Step 1: Fixing the First Point
Thanks to the symmetry of the circle, we can fix the first point anywhere. Without loss of generality, let’s place the first point at the top of the circle. The problem is unchanged since the circle is uniform.
Step 2: The Key Observation
Wherever the first point is chosen, draw the diameter through this point and the center. This diameter divides the circle into two equal semicircles.
- The first point is on the circle; the diameter through it passes through the center.
- The other two points (the second and third legs) are placed randomly on the circle.
Step 3: When Is the Center Inside the Triangle?
The central geometric fact is:
- The center of the circle is contained within the triangle formed by three points on the circumference if and only if all three points are not contained in any semicircle.
- Equivalently: The table will be unstable (fall) if all three legs are within a semicircle; stable if not.
This is a classic result in geometry.
Step 4: Counting Favorable Arrangements
- Fix the first leg at a point \(A\).
- Draw the diameter through \(A\) and the center \(O\). This divides the circle into two semicircles.
- The only way the center won’t be inside the triangle is if the other two legs, \(B\) and \(C\), are both on the same semicircle as \(A\).
- So, for every selection of \(A\), the probability that both \(B\) and \(C\) fall in the same semicircle as \(A\) is the probability the triangle does not contain the center.
Thus, the probability the center is inside the triangle (i.e., the table stands) is the probability that the three points are not all within any semicircle.
Step 5: Calculating the Probability
Let’s formalize this mathematically.
- There are three possible semicircles, each determined by a pair of points. For the three points to all lie in a semicircle, there must exist a semicircle of length \(\pi\) radians (180°) containing all three points.
- The probability that all three random points lie in a specific semicircle is proportional to the size of the semicircle, but since the points are chosen independently and uniformly, we can calculate this precisely.
Probability All Three Points Lie in a Semicircle
The probability that three random points on a circle all lie within some semicircle is known to be:
\[ P(\text{all in semicircle}) = \frac{3}{4} \]
Therefore, the probability that they do not all lie in a semicircle (i.e., the center is contained in the triangle) is:
\[ P(\text{center in triangle}) = 1 - \frac{3}{4} = \frac{1}{4} \]
Step 6: Why Is This Probability 3/4?
Let’s justify the \(3/4\) value step-by-step:
- Fix the first point (label it \(A\)), by symmetry.
- The circle is divided into two semicircles by the diameter through \(A\).
- The probability that both of the other two points (\(B\) and \(C\)) fall in the same semicircle as \(A\) is:
- For each point, the chance it falls in a particular semicircle is \(1/2\).
- So the chance both do is \( (1/2) \times (1/2) = 1/4 \).
- But there are two semicircles for each fixed first point, and three possible choices for which is the “first” point.
- Carefully, the total probability across all permutations is \(3 \times 1/4 = 3/4\).
Thus, the answer is:
\[ \boxed{\frac{1}{4}} \]
Summary Table
| Event | Probability |
|---|---|
| All 3 legs in a semicircle (unstable) | 3/4 |
| Not all 3 legs in a semicircle (stable) | 1/4 |
Alternate Approach: Arc Length Method
Let’s provide another geometric argument using arc lengths:
- Suppose three points divide the circle into arcs of length \( x, y, z \) such that \( x + y + z = 1 \) (normalized to the circumference).
- The center is inside the triangle if and only if all arcs are less than \( 1/2 \).
- The probability that all three arcs are less than \( 1/2 \) is \( 1/4 \).
Conclusion for Question 1
Therefore, the probability that the table will stand stably on its three randomly attached legs is:
\[ \boxed{\frac{1}{4}} \]
This elegant result is a favorite in quant interviews because it combines geometric probability, symmetry arguments, and a touch of intuition.
Quant Interview Question 2: Maximizing Probability of Drawing a Red Marble
Problem Statement
You have 100 marbles: 50 red and 50 blue. You want to distribute them between two drawers, in such a way that none is left outside and no drawer is left empty. After distributing them, you select a drawer at random and then pick a marble at random from that drawer. How should you distribute the marbles to maximize the probability that you draw a red marble?
Understanding the Problem
- Constraints:
- All marbles must be placed in the drawers.
- Both drawers must have at least one marble (no empty drawer).
- Drawer is chosen at random (probability 1/2 each).
- Then, a marble is chosen at random from that drawer.
- Goal: Maximize the probability of selecting a red marble.
Naive Approach: Even Split
Let’s first consider the naive approach: split the marbles evenly.
- Drawer 1: 25 red, 25 blue
- Drawer 2: 25 red, 25 blue
For each drawer, the probability of picking a red marble is \(25/50 = 0.5\).
Overall probability:
\[ P(\text{red}) = \frac{1}{2} \times 0.5 + \frac{1}{2} \times 0.5 = 0.5 \]
But can we do better?
Optimizing the Distribution
Let’s think outside the box. Notice that after choosing a drawer, the chance of picking a red marble depends on the proportion of red marbles in that drawer. What if we make one drawer very likely to yield red if picked?
Step 1: Place a Single Red Marble in Drawer 1
- Drawer 1: 1 red marble
- Drawer 2: 49 red marbles, 50 blue marbles
This distribution satisfies the constraints (no empty drawers, all marbles placed).
Step 2: Compute the Probability
- Probability of choosing Drawer 1: \( \frac{1}{2} \)
- Probability of red from Drawer 1: 1 (the only marble is red)
- Probability of choosing Drawer 2: \( \frac{1}{2} \)
- Probability of red from Drawer 2: \( \frac{49}{99} \) (since there are 49 red marbles out of 99 marbles)
So,
\[ P(\text{red}) = \frac{1}{2} \times 1 + \frac{1}{2} \times \frac{49}{99} = \frac{1}{2} + \frac{49}{198} \]
Calculating:
\[ \frac{1}{2} + \frac{49}{198} = \frac{99}{198} + \frac{49}{198} = \frac{148}{198} = \frac{74}{99} \approx 0.747 \]
This is higher than the naive approach!
Step 3: Can We Do Even Better?
What if we put more than one red marble in Drawer 1? Let’s try two red marbles in Drawer 1:
- Drawer 1: 2 red
- Drawer 2: 48 red, 50 blue
Probability from Drawer 1: \(2/2 = 1\)
Probability from Drawer 2: \(48/98\)
Total probability:
\[ P(\text{red}) = \frac{1}{2} \times 1 + \frac{1}{2} \times \frac{48}{98} = \frac{1}{2} + \frac{24}{98} = \frac{1}{2} + \frac{12}{49} \approx 0.744 \]
This is slightly lower than with only one red marble in Drawer 1.
Step 4: Generalize the Approach
Suppose Drawer 1 contains \( k \) red marbles, and Drawer 2 contains \( 50 - k \) red marbles, and all 50 blue marbles.
- Drawer 1: \( k \) red marbles
- Drawer 2: \( 50 - k \) red, 50 blue, total \( 100 - k \) marbles
Probability:
\[ P(\text{red}) = \frac{1}{2} \times 1 + \frac{1}{2} \times \frac{50-k}{100-k} \]
But since if \( k > 1 \), then probability from Drawer 1 is \(1\) only if Drawer 1 has only red marbles. If there are blue marbles in Drawer 1, the probability is \(k / n_1\), where \(n_1\) is the total number of marbles in Drawer 1.
Step 5: The Optimal Solution
The optimal way is:
- Drawer 1: 1 red marble
- Drawer 2: 49 red marbles, 50 blue marbles
Probability:
\[ P(\text{\[ P(\text{red}) = \frac{1}{2} \times 1 + \frac{1}{2} \times \frac{49}{99} = \frac{1}{2} + \frac{49}{198} = \frac{99}{198} + \frac{49}{198} = \frac{148}{198} = \frac{74}{99} \approx 0.747 \]
This is indeed the maximum possible probability, as shown by our calculation in Step 4. If you try any other arrangement—such as putting more than one red marble or any blue marbles in Drawer 1—the probability decreases. Therefore, the optimal distribution is:
- Drawer 1: 1 red marble, 0 blue marbles
- Drawer 2: 49 red marbles, 50 blue marbles
Why Is This the Best Arrangement?
Let’s explain the intuition behind this solution:
- By placing a single red marble in Drawer 1, you guarantee that if this drawer is selected (which happens with probability 1/2), you will always get a red marble.
- The remaining red and blue marbles are all in Drawer 2, but now the ratio of red to total marbles in Drawer 2 is less than 0.5, yet the overall probability is maximized because of the guaranteed success in Drawer 1.
- If you put more marbles in Drawer 1, you must also put blue marbles (to avoid emptying Drawer 2), which lowers the guaranteed probability from Drawer 1 and also slightly increases the number of blue marbles in Drawer 2, both reducing the overall chance.
General Formula for Any Number of Marbles
If you have \( R \) red marbles and \( B \) blue marbles, the optimal strategy is:
- Drawer 1: 1 red marble
- Drawer 2: \( R - 1 \) red marbles, \( B \) blue marbles
The probability becomes:
\[ P(\text{red}) = \frac{1}{2} \times 1 + \frac{1}{2} \times \frac{R-1}{B + R - 1} \]
Why Not Put All Marbles in One Drawer?
This is not allowed by the problem’s constraints: “no drawer is left empty.” Both drawers must have at least one marble.
Alternative Strategies Analyzed
Let’s briefly look at some other possible strategies and their probabilities:
Strategy 1: Even Split
- Drawer 1: 25 red, 25 blue
- Drawer 2: 25 red, 25 blue
\[ P(\text{red}) = \frac{1}{2} \times \frac{25}{50} + \frac{1}{2} \times \frac{25}{50} = 0.5 \]
Strategy 2: Slightly Unbalanced Split
- Drawer 1: 26 red, 24 blue
- Drawer 2: 24 red, 26 blue
\[ P(\text{red}) = \frac{1}{2} \times \frac{26}{50} + \frac{1}{2} \times \frac{24}{50} = \frac{26+24}{100} = 0.5 \]
Strategy 3: All Marbles but One in Drawer 2
- Drawer 1: 1 red
- Drawer 2: 49 red, 50 blue
Already calculated above: \( P(\text{red}) = \frac{74}{99} \approx 0.747 \)
Strategy 4: Put 1 blue in Drawer 1
- Drawer 1: 1 blue
- Drawer 2: 50 red, 49 blue
\[ P(\text{red}) = \frac{1}{2} \times 0 + \frac{1}{2} \times \frac{50}{99} = 0.505 \]
Much worse than optimal.
Summary Table: Probability by Distribution
| Drawer 1 | Drawer 2 | Total Red Probability |
|---|---|---|
| 1 red | 49 red + 50 blue | 74/99 ≈ 0.747 |
| 25 red + 25 blue | 25 red + 25 blue | 0.5 |
| 2 red | 48 red + 50 blue | 0.744 |
| 1 blue | 50 red + 49 blue | 0.505 |
Python Code to Simulate and Verify
import random
def experiment(drawer1, drawer2, trials=100000):
count = 0
for _ in range(trials):
if random.random() < 0.5:
# Drawer 1
if random.choice(drawer1) == 'red':
count += 1
else:
# Drawer 2
if random.choice(drawer2) == 'red':
count += 1
return count / trials
# Optimal setup
drawer1 = ['red']
drawer2 = ['red'] * 49 + ['blue'] * 50
print("Simulated probability:", experiment(drawer1, drawer2))
Running this code will yield a result very close to the analytical value of 0.747.
Key Takeaways from This Classic Quant Question
- Sometimes, the optimal solution is not the most “intuitive” or “even” division.
- Guaranteeing success in one branch (here, Drawer 1) can outweigh slightly worse odds elsewhere.
- Quant interviews often test for creative, boundary-pushing thinking in addition to calculation skills.
Conclusion: Lessons from Jane Street Interview Questions
The two quant interview questions explored above illustrate the type of analytical and creative thinking Jane Street and other top trading firms look for:
- The three-legged table problem tests your understanding of geometric probability, use of symmetry, and ability to reason from first principles. The surprising answer, \( \frac{1}{4} \), rewards those who break down the problem into its fundamental symmetries.
- The marble distribution problem challenges your intuition. The optimal solution—putting a single red marble in one drawer—demonstrates the value of considering edge cases and maximizing guaranteed outcomes.
Mastering such problems involves not just mathematical skill, but also pattern recognition, creative reasoning, and strategic thinking. If you’re gearing up for a quant interview at Jane Street or any other top firm, practice dissecting each problem, challenging your assumptions, and seeking out non-obvious solutions. These skills will serve you well both in interviews and on the trading floor!
Further Reading and Practice
- Jane Street Quantitative Trader Careers
- Probability that the center is in a random triangle (Euclid)
- Geometric Probability (Wikipedia)
By understanding the logic behind these classic puzzles and practicing similar questions, you’ll be well on your way to acing your quant interviews!
