blog-cover-image

Quant Research Interview Test - Jane Street

Quantitative research interviews at top trading firms like Jane Street are renowned for their rigor, creativity, and testing of true mathematical intuition. If you’re preparing for a quant research or trading role, it’s invaluable to see the types of questions you might face—especially the format and the level of detailed, logical reasoning expected. This article shares a firsthand experience of a Jane Street quant research interview HackerRank test, along with thoroughly explained solutions to each question. Whether you’re actively interviewing or just want to hone your probability and problem-solving skills, these sample problems and solutions will help you practice and prepare for your next big opportunity.


Jane Street Quant Research Interview Test: Questions and Detailed Solutions

The HackerRank test described here consisted of 4 questions, to be solved in 30 minutes. Each is designed to probe your understanding of probability, expected value, and optimal decision-making—core skills for any quant research or trading role.

Test Outline

  • Time: 30 minutes
  • Number of Questions: 4
  • Topics: Probability, Combinatorics, Expected Value, Bayes’ Theorem, Optimal Strategy

Question 1: Probability of Even Sum from First 16 Prime Numbers

Problem Statement

We randomly select 4 numbers from the set of the first 16 prime numbers, without replacement. What is the probability their sum is even? Why?

Detailed Solution

Let’s break this down step by step.

Step 1: List the First 16 Prime Numbers

The first 16 primes are:

  • 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53

Step 2: Analyzing Parity (Odd/Even)

Among these, only 2 is even; the rest (3, 5, ..., 53) are all odd.

  • Number of even primes = 1 (the number 2)
  • Number of odd primes = 15

Step 3: When is the Sum Even?

The sum of four numbers is even if either:

  • All four numbers are even, or
  • Two numbers are even and two are odd, or
  • All four numbers are odd

But with only one even number, it’s impossible to select more than one even number. So, possible scenarios:

  • Scenario 1: All four are odd
  • Scenario 2: One even (2), three odd

Step 4: Parity of Sums

- The sum of four odd numbers: Odd + Odd = Even, Even + Odd = Odd, Odd + Odd = Even. But in general, the sum of an even number of odd numbers is always even.

- The sum of one even + three odd: Even + Odd = Odd, Odd + Odd = Even, Even + Even = Even. The sum of three odd numbers is odd, and odd + even = odd. So, the sum is odd.

Step 5: Only One Way to Get Even Sum

Thus, only way to get an even sum is to pick four odd primes.

Step 6: Compute the Probability

  • Total ways to pick 4 primes: \( \binom{16}{4} \)
  • Ways to pick 4 odd primes: \( \binom{15}{4} \)
  • Probability = \( \frac{\binom{15}{4}}{\binom{16}{4}} \)

So the probability is:

\[ \boxed{ \text{Probability} = \frac{3}{4} } \]

Final Answer

Probability = \(\frac{3}{4}\)


Question 2: Optimal Strategy for the 8-Sided Die Game

Problem Statement

You have an 8-sided die. You get to roll the die once, see the result, and then may choose to either stop or roll again. Your payoff is the sum of your rolls, unless this sum is greater than 8, in which case you "bust" and get nothing. What is your strategy for this game? That is, for each possible outcome of the first roll will you choose stop or to roll again?

Detailed Solution

Step 1: Understanding the Problem

  • First roll: always 1 to 8, equally likely.
  • If you stop, you get the value of your first roll.
  • If you roll again, your total payoff is the sum of both rolls—unless it exceeds 8, in which case payoff is 0.
  • Goal: For each first roll value (1-8), decide whether to stop or continue, to maximize expected value.

Step 2: Calculate Expected Value for Rolling Again

Let \( x \) be the first roll (from 1 to 8).

If you roll again, the second roll \( y \) is also 1 to 8. If \( x + y \leq 8 \), you get \( x + y \); otherwise, payoff is 0.

Expected value if you roll again:

\[ E_{\text{again}}(x) = \frac{1}{8} \sum_{y=1}^{8} \begin{cases} x + y & \text{if } x + y \leq 8 \\ 0 & \text{otherwise} \end{cases} \]

For each fixed \( x \), the values of \( y \) that satisfy \( x + y \leq 8 \) are \( y = 1 \) to \( y = 8 - x \).

So:

\[ E_{\text{again}}(x) = \frac{1}{8} \sum_{y=1}^{8-x} (x + y) \]

Expanding the sum:

\[ \sum_{y=1}^{8-x} (x + y) = \sum_{y=1}^{8-x} x + \sum_{y=1}^{8-x} y = x(8-x) + \frac{(8-x)(8-x+1)}{2} \]

Thus,

\[ E_{\text{again}}(x) = \frac{1}{8} \left[ x(8-x) + \frac{(8-x)(8-x+1)}{2} \right] \]

Step 3: Should You Stop or Go?

You compare \( E_{\text{again}}(x) \) to simply stopping and taking \( x \).

  • If \( E_{\text{again}}(x) > x \), you should roll again.
  • If \( E_{\text{again}}(x) \leq x \), you should stop.

Step 4: Calculate for Each Value of \( x \) (1 to 8)

x (First Roll) y Range Sum Terms E_again(x) Stop or Roll Again?
1 1–7 \( 1 \times 7 + \frac{7 \times 8}{2} = 7 + 28 = 35 \) \( \frac{35}{8} = 4.375 \) Roll Again (since 4.375 > 1)
2 1–6 \( 2 \times 6 + \frac{6 \times 7}{2} = 12 + 21 = 33 \) \( \frac{33}{8} = 4.125 \) Roll Again (since 4.125 > 2)
3 1–5 \( 3 \times 5 + \frac{5 \times 6}{2} = 15 + 15 = 30 \) \( \frac{30}{8} = 3.75 \) Roll Again (since 3.75 > 3)
4 1–4 \( 4 \times 4 + \frac{4 \times 5}{2} = 16 + 10 = 26 \) \( \frac{26}{8} = 3.25 \) Roll Again (since 3.25 > 4 is FALSE)
5 1–3 \( 5 \times 3 + \frac{3 \times 4}{2} = 15 + 6 = 21 \) \( \frac{21}{8} = 2.625 \) Roll Again (2.625 < 5 is FALSE)
6 1–2 \( 6 \times 2 + \frac{2 \times 3}{2} = 12 + 3 = 15 \) \( \frac{15}{8} = 1.875 \) Roll Again (1.875 < 6 is FALSE)
7 1 \( 7 \times 1 + \frac{1 \times 2}{2} = 7 + 1 = 8 \) \( \frac{8}{8} = 1 \) Roll Again (1 < 7 is FALSE)
8 None 0 0 Roll Again (0 < 8 is FALSE)

Step 5: Interpretation and Final Strategy

- For \( x = 1, 2, 3 \): Roll again - For \( x \geq 4 \): Stop

Final Answer

For first roll values 1, 2, or 3, roll again. For 4 or higher, stop. This is because the expected payoff from rolling again is higher than stopping only for first roll values less than 4.


Question 3: Probability of Getting Heads Again (Bayesian Update)

Problem Statement

A bag has three coins in it which are visually indistinguishable, but when flipped, one coin has a 20% chance of coming up heads, another has a 20% chance of coming up heads, and the last has 60% chance of coming up heads. I randomly draw a coin from the bag and flip it, and the result comes up heads. What is the probability that if I reflip this coin, it will come up heads again? Why?

Detailed Solution

Step 1: Understanding the Problem

  • Three coins: A (20% heads), B (20% heads), C (60% heads)
  • Picked at random; flipped; result is heads
  • What is \( P(\text{heads on 2nd flip} \mid \text{heads on 1st flip}) \)?

Step 2: Use Bayes’ Theorem

Let’s denote:

  • \( C_A \): coin A (20%)
  • \( C_B \): coin B (20%)
  • \( C_C \): coin C (60%)

The chance of picking any coin is \( \frac{1}{3} \).

 

Probability of getting heads on the first flip:

\[ P(\text{heads}) = P(\text{heads}|C_A)P(C_A) + P(\text{heads}|C_B)P(C_B) + P(\text{heads}|C_C)P(C_C) = 0.2 \times \frac{1}{3} + 0.2 \times \frac{1}{3} + 0.6 \times \frac{1}{3} \] \[ = \frac{0.2 + 0.2 + 0.6}{3} = \frac{1.0}{3} \]

Now, the probability that we picked coin \( CA \((C_A)\), given that we observed heads on the first flip, by Bayes' theorem: \[ P(C_A | \text{heads}) = \frac{P(\text{heads} | C_A) \cdot P(C_A)}{P(\text{heads})} = \frac{0.2 \times \frac{1}{3}}{\frac{1}{3}} = 0.2 \] Similarly for coin B: \[ P(C_B | \text{heads}) = \frac{0.2 \times \frac{1}{3}}{\frac{1}{3}} = 0.2 \] And for coin C: \[ P(C_C | \text{heads}) = \frac{0.6 \times \frac{1}{3}}{\frac{1}{3}} = 0.6 \]

Step 3: Compute the Probability of Heads on the Second Flip

The probability of heads on the second flip, given that the first flip was heads, is:

\[ P(\text{heads on 2nd flip}|\text{heads on 1st flip}) = \sum_{i} P(\text{heads on 2nd flip}|C_i) \cdot P(C_i|\text{heads on 1st flip}) \]

Plugging in our values:

\[ = 0.2 \times 0.2 + 0.2 \times 0.2 + 0.6 \times 0.6 = 0.04 + 0.04 + 0.36 = 0.44 \]

Final Answer

The probability that the same coin shows heads on the second flip, given that it showed heads on the first flip, is \(0.44\) (or 44%). This makes sense: seeing heads makes it more likely you picked the "biased" coin, and you update your belief using Bayes' theorem.


Question 4: Urn Problem – Which Urn Should You Choose?

Problem Statement

We have two urns. You can't tell them apart from the outside, but one has four $1 chips and six $10 chips, and the other has three $1 chips and seven $10 chips. You randomly draw a chip from one of the urns and it happens to be a $1 chip. Without replacing this draw, I offer you a chance to draw and keep a chip from either urn. Should you draw from the same urn or the opposite urn, and what is the expected value of the chip you draw? Why?

Detailed Solution

Step 1: Assign Labels and Notation

  • Urn A: 4 x $1, 6 x $10 chips (10 chips total)
  • Urn B: 3 x $1, 7 x $10 chips (10 chips total)
  • We pick an urn at random, then draw a chip, which is $1.
  • Now choose to draw a chip (without replacement) from either the same urn or the other urn.

Step 2: Calculate Posterior Probabilities

Let’s use Bayes’ theorem to update the probability that the urn we drew from was A or B, given we drew a $1 chip.

Let:

  • \( U_A \): drew from Urn A
  • \( U_B \): drew from Urn B

 

Each urn is equally likely: \( P(U_A) = P(U_B) = 0.5 \).

Probability of drawing a $1 chip from A: \( P(\$1 | U_A) = \frac{4}{10} = 0.4 \)
Probability of drawing a $1 chip from B: \( P(\$1 | U_B) = \frac{3}{10} = 0.3 \)

Total probability of drawing a $1 chip:

\[ P(\$1) = 0.5 \times 0.4 + 0.5 \times 0.3 = 0.2 + 0.15 = 0.35 \]

By Bayes’ theorem:

\[ P(U_A|\$1) = \frac{0.5 \times 0.4}{0.35} = \frac{0.2}{0.35} = \frac{4}{7} \] \[ P(U_B|\$1) = \frac{0.5 \times 0.3}{0.35} = \frac{0.15}{0.35} = \frac{3}{7} \]

Step 3: Compute Expected Value for Each Option

Option 1: Draw from the Same Urn (Urn you drew the $1 from, now has one fewer $1 chip)
  • If the urn is A: Now 3 x $1, 6 x $10 chips left (9 chips)
  • If the urn is B: Now 2 x $1, 7 x $10 chips left (9 chips)

Expected value:

\[ E_{\text{same}} = P(U_A|\$1) \times E_{\text{A}} + P(U_B|\$1) \times E_{\text{B}} \]

For A: \( \frac{3}{9} \) chance of $1, \( \frac{6}{9} \) chance of $10:

\[ E_{\text{A}} = \frac{3}{9} \times 1 + \frac{6}{9} \times 10 = \frac{3}{9} + \frac{60}{9} = \frac{63}{9} = 7 \]

For B: \( \frac{2}{9} \) chance of $1, \( \frac{7}{9} \) chance of $10:

\[ E_{\text{B}} = \frac{2}{9} \times 1 + \frac{7}{9} \times 10 = \frac{2}{9} + \frac{70}{9} = \frac{72}{9} = 8 \]

So,

\[ E_{\text{same}} = \frac{4}{7} \times 7 + \frac{3}{7} \times 8 = \frac{28}{7} + \frac{24}{7} = \frac{52}{7} \approx 7.43 \]

Option 2: Draw from the Other Urn (Untouched Urn)
  • Urn A: 4 x $1, 6 x $10 chips (10 chips)
  • Urn B: 3 x $1, 7 x $10 chips (10 chips)

Expected value:

\[ E_{\text{other}} = P(U_A|\$1) \times E_{\text{B,full}} + P(U_B|\$1) \times E_{\text{A,full}} \]

- If you originally drew from A (prob \( \frac{4}{7} \)), the other urn is B: \( E_{\text{B,full}} = 0.3 \times 1 + 0.7 \times 10 = 0.3 + 7 = 7.3 \) - If you originally drew from B (prob \( \frac{3}{7} \)), the other urn is A: \( E_{\text{A,full}} = 0.4 \times 1 + 0.6 \times 10 = 0.4 + 6 = 6.4 \)

\[ E_{\text{other}} = \frac{4}{7} \times 7.3 + \frac{3}{7} \times 6.4 = \frac{29.2}{7} + \frac{19.2}{7} = \frac{48.4}{7} \approx 6.91 \]

Step 4: Conclusion

You should draw from the same urn. The expected value is higher:

  • Expected value if you draw from the same urn: \(\frac{52}{7} \approx \$7.43\)
  • Expected value if you draw from the other urn: \(\frac{48.4}{7} \approx \$6.91\)

This is because drawing a $1 chip makes it more likely you picked the urn with more $1 chips (Urn A), which now has proportionally more $10 chips left after removing a $1. The Bayesian update increases your expected value when you draw from the same urn.


Summary Table: Answers at a Glance

Question Answer Reasoning
Sum Even from 4 of 16 Primes \(\frac{273}{364}\) Only possible if all four are odd; 15 odd primes.
8-Sided Die Strategy Roll again if 1, 2, or 3; stop if 4 or higher Expected value for lower rolls is higher if rerolled.
Coin Flip Bayesian Update 44% Update your belief; more likely you have the biased coin after seeing heads.
Urn Draw Strategy Draw from same urn; expected value ≈ $7.43 Bayes' theorem: more likely in the urn with more $1s, but after one is removed, $10s dominate.

Conclusion: How to Prepare for Jane Street Quant Research Tests

Jane Street’s quant research interviews are a test of deep, practical understanding of probability, statistics, and optimal decision-making. These four questions illustrate the kind of thinking required: not just rote formulas, but careful logical analysis, often using Bayes’ theorem and expected value computations.

Tips for your preparation:

  • Practice combinatorics and probability questions, especially those involving conditional probability and Bayes' theorem.
  • Get comfortable with expected value calculations and "optimal stopping" strategies.
  • Be ready to explain your reasoning step-by-step, as clarity and logical flow are as important as the final answer.
  • Time yourself on practice problems—speed and accuracy both matter.

With enough practice, you can develop the intuition and precision that Jane Street and other elite quant firms are looking for.


Further Resources

Best of luck with your quant interview preparation!

Related Articles