Coin Flips to Three Straight Heads
Flipping Coins Until Three Heads Row is a medium quant interview question on Expected Value, reported to have been seen at Goldman Sachs.
MyQuantPartner is not affiliated with, endorsed by, or sponsored by these companies, and all trademarks belong to their respective owners.
This classic expected value question from quant interviews is about the waiting time until a specific pattern appears in a random sequence. It looks simple on the surface, with only a basic probability setup, but it quickly becomes nontrivial once you realise the process has memory through the current streak. That makes it a good example of how quant interviewers turn elementary-looking setups into deeper stochastic thinking.
It trains your ability to formalise a sequential random process into states and to express expectations in terms of each other. You practice building and solving a small system that captures how progress toward a target pattern can be lost or partially preserved. This is central to quant prep because it reinforces comfort with random walks, streaks, and path-dependent behaviour.
This matters in quant interviews because many pricing, risk, and algorithmic trading problems involve time to hit a barrier, complete a pattern, or trigger a condition. Interviewers use this to see if you can translate an intuitive story about runs of outcomes into a rigorous stochastic model. Performing well on this type of quant prep question signals that you can handle Markov-style reasoning, first-passage expectations, and state-based modeling under pressure.
What it tests
Problems that ask for the expected time to reach a specific sequence (like consecutive heads) in a random process are governed by the idea of Markov chains and first passage times. The key is to model the process as a set of 'states' defined by relevant memory: here, the number of consecutive successes so far. The expected time from each state can be recursively related to the expected times from other states, because the process is memoryless except for the current streak. This recursive structure arises because, at each step, the process either advances toward the goal or resets, and the expected value at each state is a weighted sum of the next possible states. The reason this pattern holds is that the process's future evolution depends only on the current state, not the full history, and the expectation can be built up from the possible transitions at each step.
Practise this question with written feedback, or hear it in a spoken mock interview.
Get started free