← Jane Street Interview Insights

Jane Street·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

Jane Street Data Scientist interview with a probability/game theory problem involving optimal dice strategy. The math is clean but the reasoning chain to get there is genuinely tricky, especially under pressure.

Questions Asked (1)

Q1

Alice rolls a fair 30-sided die and Bob rolls a fair 20-sided die. Whoever shows the higher number wins, with ties going to Bob. Bob can reroll once after seeing his first result, but he never sees Alice's number before deciding, and his second roll is binding. Assuming Bob plays optimally, what is the probability that Alice wins?

Algorithms & Data StructuresProduct Analytics & Metrics
Author's notes

This one took me a while to set up properly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model Bob's optimal strategy by determining a threshold t such that he rerolls if his first roll is ≤ t, then compute the probability Alice wins by conditioning on Bob's final roll. Use dynamic programming or direct probability calculations to find the optimal t and the resulting win probability.

Pro tip: Clearly state that Bob's decision is based solely on his first roll and not on Alice's, and that ties go to Bob, which effectively gives Bob a +0.5 advantage in comparisons.

1. Define Bob's strategy

Let Bob reroll if his first roll is ≤ t, where t is an integer between 0 and 20. If he rerolls, his final roll is uniform on 1..20; otherwise, it's his first roll.

2. Compute Bob's final roll distribution

For a given t, compute the probability mass function of Bob's final roll: P(final = k) = P(first = k and k > t) + P(reroll) * P(second = k).

3. Express Alice's win probability

Given Bob's final roll distribution, Alice wins if her roll > Bob's final roll (since ties go to Bob). So P(Alice wins) = sum_{k=1}^{20} P(Bob final = k) * P(Alice > k).

4. Optimize over t

Find the t that minimizes Alice's win probability (or maximizes Bob's win probability). This can be done by evaluating the expression for each t from 0 to 20.

5. Compute final probability

Plug the optimal t into the expression to get the exact probability that Alice wins.

Key Points to Mention

  • Bob's optimal strategy is a threshold strategy: reroll if first roll ≤ t.
  • Ties go to Bob, so Alice must roll strictly higher than Bob's final roll to win.
  • Bob's final roll distribution depends on t and is a mixture of the truncated first roll and the reroll.
  • The optimal t can be found by comparing the expected win probability for each t.
  • The final probability is a rational number; compute it exactly or to sufficient precision.
  • Consider edge cases: t=0 (never reroll) and t=20 (always reroll) to bound the optimal t.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.