Expected Tosses for Consecutive Heads Patterns

Average tosses for three heads pattern is a medium quant interview question on Stochastic Calculus.

Difficulty Medium Topic Stochastic Calculus

This question studies how long it takes for particular patterns of consecutive coin flips to appear, and which of two competing patterns is more likely to show up first. The setup focuses on waiting times until specific sequences of heads and tails occur in an otherwise simple, memoryless process. It first isolates different target patterns, then asks you to compare them, and finally pits them against each other in a "race" to occur first. Variants of this style of pattern-hitting-time problem are common in interviews for quant trading and research roles, especially where understanding of discrete probabilistic dynamics is important.

To tackle it, you need to formalize the relevant "history" of recent flips into a minimal state space and then write down and solve linear relations between expectations or probabilities attached to those states. The problem leans on Markov chain thinking, conditional expectation, and symmetry or asymmetry of patterns. An interviewer is looking for whether you can construct the states cleanly, set up correct recursion, and manipulate the resulting system without getting lost, while also interpreting what the final comparisons mean.

What it tests

Problems involving the expected time or probability to reach a particular sequence in a random process, such as coin tosses, are governed by the principle of Markov chains and the memoryless property of the process. The key is to model the system as a set of states that encode the relevant history needed to determine progress toward the target sequence. Each state represents a distinct situation with respect to the goal, and transitions between states are determined solely by the outcome of the next random event. The expected value or probability from each state can be recursively defined in terms of the expected values or probabilities from subsequent states, leading to a system of equations. This structure holds because, in a Markov process, the future evolution depends only on the current state, not on the path taken to reach it.

Practise this question with written feedback, or hear it in a spoken mock interview.

Get started free