← Optiver Interview Insights

Optiver·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Optiver Data Scientist interview with a probability puzzle that sounds deceptively clean but requires some real combinatorial thinking to get right.

Questions Asked (1)

Q1

A bag has 10 red, 10 yellow, and 10 blue counters. You draw counters one at a time at random without replacement until only two colors remain. What is the expected number of counters left in the bag at that point?

Algorithms & Data Structures
Author's notes

I stared at this for a bit and tried to brute-force the intuition first, which was a mistake.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the process as drawing counters until one color is exhausted, then compute the expected number of remaining counters by analyzing the last color to be eliminated. Use symmetry and linearity of expectation to simplify the calculation, focusing on the distribution of the final draw sequence.

Pro tip: Clarify that the process stops when only two colors remain, meaning one color has been completely drawn. This reframing often simplifies the problem and shows you can identify the key event.

1. Understand the stopping condition

Recognize that the process stops when one color is completely removed from the bag, leaving exactly two colors. This is equivalent to the first time any color's count reaches zero.

2. Define the random variable

Let X be the number of counters left when the first color is exhausted. Express X as the sum of the remaining counts of the two colors that are not exhausted.

3. Use symmetry and linearity of expectation

By symmetry, each color is equally likely to be the first exhausted. Condition on which color is exhausted first and compute the expected remaining counts of the other two colors.

4. Compute conditional expectations

For a given first-exhausted color, the remaining draws from the other two colors follow a known distribution (e.g., negative hypergeometric). Calculate the expected sum of their remaining counts.

5. Combine results and verify

Average over the three possible first-exhausted colors to get the overall expected value. Sanity-check with simulation or edge cases.

Key Points to Mention

  • The process stops when the first color is completely drawn, not when two colors are fully drawn.
  • Symmetry among the three colors simplifies the calculation.
  • Linearity of expectation can be applied without independence.
  • The remaining counters are from the two colors that still have counters in the bag.
  • Conditioning on which color is exhausted first is a valid strategy.
  • The expected value can be computed by analyzing the last draw of the exhausted color.

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