Quant interview prep guides

Coin flips, for quant interviews

A coin flip is the simplest random variable there is, which is exactly why interviewers use it — every question is really a probe of whether you actually understand independence, waiting times, and how patterns overlap, or whether you just memorized “it’s 50/50.”

For candidates drilling probability fundamentals and expectation arguments · Updated July 21, 2026

The coin has no memory

The starting question is almost always a trap disguised as a warm-up: a fair coin has come up heads five times in a row — what's the probability the next flip is tails? The answer is 1/21/21/2, and the interviewer is watching to see if you flinch. Independent flips carry no memory; the coin cannot ‘owe’ you a tail. What people confuse is two different quantities. Calling six heads in advance is genuinely unlikely — (1/2)6=1/64≈1.6%(1/2)^6 = 1/64 \approx 1.6\%(1/2)6=1/64≈1.6% — but conditioned on the five heads that already landed, the sixth flip is an ordinary 1/21/21/2. The rare event already happened; it doesn't get ‘paid back.’ Say this crisply and you've cleared the filter the question exists to apply.

Expected flips: the waiting-time question

The signature coin question is a waiting time: how many fair flips, on average, until you first see the pattern HH? And until HT? The surprise the interviewer is hunting for is that these differ — E[HH]=6\E[\text{HH}] = 6E[HH]=6 but E[HT]=4\E[\text{HT}] = 4E[HT]=4 — even though each two-flip pattern is equally likely in isolation. The reason is overlap, and the clean way to show it is a two-state Markov argument.

For HT, let aaa be the expected flips from scratch and bbb the expected flips once you're holding a head. From scratch, one flip either gives a head (go to state bbb) or a tail (stay): a=1+12b+12aa = 1 + \tfrac12 b + \tfrac12 aa=1+21​b+21​a. Once you hold a head, a tail finishes and a head just keeps you holding a head: b=1+12⋅0+12bb = 1 + \tfrac12\cdot 0 + \tfrac12 bb=1+21​⋅0+21​b. The second equation gives b=2b = 2b=2; substituting, 12a=1+12(2)=2\tfrac12 a = 1 + \tfrac12(2) = 221​a=1+21​(2)=2, so a=4a = 4a=4.

For HH the algebra is identical except for one arrow. Once you hold a head, a tail doesn't keep you waiting — it throws you back to the start: b=1+12⋅0+12ab = 1 + \tfrac12\cdot 0 + \tfrac12 ab=1+21​⋅0+21​a, while a=1+12b+12aa = 1 + \tfrac12 b + \tfrac12 aa=1+21​b+21​a. From the second, a=2+ba = 2 + ba=2+b; substituting into b=1+12ab = 1 + \tfrac12 ab=1+21​a gives b=1+12(2+b)=2+12bb = 1 + \tfrac12(2+b) = 2 + \tfrac12 bb=1+21​(2+b)=2+21​b, so b=4b = 4b=4 and a=6a = 6a=6. That single backward arrow — a tail after a head deletes your progress — is the entire two-flip gap.

Waiting-time automata for HH versus HTChasing HH, a tail after a head returns you to the start state; chasing HT, a head after a head keeps you in the same state, so HH takes six flips on average and HT takes four.TARGET HH — EXPECTED 6 FLIPSSTARTHDONEHHTTtail wipes progressTARGET HT — EXPECTED 4 FLIPSSTARTHDONEHTTHhead keeps progress
Both machines start the same. The only difference is what a “wrong” flip does once you hold a head: chasing HH, a tail throws you all the way back to start (the long slate arc); chasing HT, a stray head just leaves you where you were (the short emerald loop). That one backward arrow is the whole 6-versus-4 gap.

The formula behind the number

You don't have to rebuild the Markov chain every time. Conway's leading-number identity gives the expected waiting time for any pattern under a fair coin as a sum over its self-overlaps: for each length iii where the pattern's first iii symbols equal its last iii symbols, add 2i2^i2i.

E[HH]=22+21=6,E[HT]=22=4.\E[\text{HH}] = 2^2 + 2^1 = 6, \qquad \E[\text{HT}] = 2^2 = 4.E[HH]=22+21=6,E[HT]=22=4.

HH overlaps itself at length 2 (the whole word) and length 1 (its trailing H is also a leading H), so it collects both terms. HT overlaps only at length 2, because a trailing T is not a leading H. Push to three symbols and the same rule predicts E[HHH]=23+22+21=14\E[\text{HHH}] = 2^3 + 2^2 + 2^1 = 14E[HHH]=23+22+21=14 while E[HTH]=23+21=10\E[\text{HTH}] = 2^3 + 2^1 = 10E[HTH]=23+21=10 — more self-similar patterns are always slower to arrive. And it generalizes off the fair coin: with P(H)=p\Prob(H)=pP(H)=p and q=1−pq = 1-pq=1−p, the two-state derivation yields E[HH]=(1+p)/p2\E[\text{HH}] = (1+p)/p^2E[HH]=(1+p)/p2 and E[HT]=1/p+1/q\E[\text{HT}] = 1/p + 1/qE[HT]=1/p+1/q, which collapse to 666 and 444 at p=12p = \tfrac12p=21​.

Expected flips to first see each two-flip pattern (fair coin)HT and TH each take four flips on average; HH and TT each take six.EXPECTED FLIPS TO FIRST OCCURRENCE · FAIR COIN0246flips until first occurrenceno self-overlapself-overlappingHT4TH4HH6TT6
Patterns whose ending can’t restart themselves — HT, TH — arrive in 4 flips. Patterns that can (HH, TT) waste flips rebuilding lost progress and take 6. By symmetry HT = TH and HH = TT exactly.

Streaks and runs

Waiting times explain a fact interviewers like to test directly: in a short block of flips, some patterns are simply likelier to appear than others. Enumerate all 23=82^3 = 823=8 equally likely outcomes of three fair flips. The pattern HH shows up in exactly three of them — HHH, HHT, THH — so P(HH appears)=3/8\Prob(\text{HH appears}) = 3/8P(HH appears)=3/8. The pattern HT shows up in four — HHT, HTH, HTT, THT — so P(HT appears)=4/8=1/2\Prob(\text{HT appears}) = 4/8 = 1/2P(HT appears)=4/8=1/2. Same asymmetry, same cause: HT is the easier pattern to stumble into, which is why its waiting time is shorter. A related run question — the probability that nnn flips contain no two consecutive heads — is counted by Fibonacci numbers, F(n+2)/2nF(n{+}2)/2^nF(n+2)/2n; for n=4n=4n=4 that's F(6)/16=8/16=1/2F(6)/16 = 8/16 = 1/2F(6)/16=8/16=1/2.

All eight outcomes of three fair flipsEach flip splits into heads (up) and tails (down). Of the eight equally likely leaves, HHH, HHT and THH contain the pattern HH; HHT, HTH, HTT and THT contain HT.HTHTHTHTHTHTHTHHH1/8HHT1/8HTH1/8HTT1/8THH1/8THT1/8TTH1/8TTT1/8HH appears in 3 of 8 = 3/8HT appears in 4 of 8 = 1/2
In three flips there are eight equally likely stories. HH turns up in three of them, HT in four — the same asymmetry that makes HH the slower pattern to wait for. Rarer to appear, longer to arrive.

Biased coins, and faking a fair one

Change P(H)\Prob(H)P(H) to ppp and two things happen. First, the expected flips to a single head is 1/p1/p1/p — with variance (1−p)/p2(1-p)/p^2(1−p)/p2 (for the fair coin, mean 222 and variance 222). Second, and more fun to be asked: given only a biased coin of unknown ppp, produce a perfectly fair bit. Von Neumann's trick: flip twice. Map HT to ‘heads’ and TH to ‘tails’ — each occurs with probability p(1−p)p(1-p)p(1−p), so they're exactly equal whatever ppp is — and discard HH or TT, reflipping. A pair is usable with probability 2p(1−p)2p(1-p)2p(1−p), so you burn 1/(p(1−p))1/\big(p(1-p)\big)1/(p(1−p)) flips per fair bit on average: 444 flips when p=12p=\tfrac12p=21​, about 4.764.764.76 when p=0.7p=0.7p=0.7. The bias cancels because you only ever compare two mutually exclusive, equal-probability orderings.

Variants that change the answer

The waiting-time result is fragile in instructive ways, and naming the fragility is what separates a strong candidate:

  • First to appear (Penney's game). Change the question from ‘how long to HH’ to ‘which of HH vs HT appears first,’ and most candidates expect the same asymmetry — but this race is a genuine 50/50 tie. Both patterns begin with H, so nothing is decided until the first head lands; the very next flip then resolves it — another head completes HH, a tail completes HT, each with probability 12\tfrac1221​. The real Penney asymmetry needs patterns that share less of a prefix: for example TH beats HH with probability 3/43/43/4 (HH can only win the race if the first two flips are both heads, probability 1/41/41/4). Extend to three-symbol patterns and the game becomes genuinely non-transitive — for any pattern your opponent picks, you can pick one that beats it. (Note the contrast with the streaks section: HT is more likely than HH to appear within a fixed short block, but in the unbounded ‘who's first’ race against HH it only ties.)
  • Order matters, not just counts. Two flips giving ‘one head and one tail’ has probability 12\tfrac1221​ (HT or TH), not 13\tfrac1331​ — the outcomes HT and TH are distinct. Treating unordered counts as equally likely is the fastest way to a wrong number.
  • Biased coin. Every clean answer above assumed p=12p=\tfrac12p=21​. If the coin is biased, E[HH]=(1+p)/p2\E[\text{HH}]=(1+p)/p^2E[HH]=(1+p)/p2, the streak probabilities shift, and ‘50/50’ reasoning is simply wrong. Always confirm the coin is fair before you use symmetry.

Common mistakes

  • The gambler’s fallacy. Believing a tail is “due” after a run of heads. Independence means the conditional probability is unchanged; only the ex ante run was rare.
  • Assuming all patterns wait the same. Answering that HH and HT both take 4 (or both 6) flips. The self-overlap of HH costs two extra flips — you must track whether a failure destroys progress.
  • Confusing “appears in a block” with “waiting time.” These are different questions with different answers; read which one is being asked.
  • Dropping the discard branch in Von Neumann. Forgetting that HH/TT are thrown away is how candidates “prove” the extractor is biased.

Practice the pattern

Coin questions reward one habit — always ask whether the outcomes you’re counting are ordered, independent, and overlapping, before you reach for a number. Drill waiting-time and expectation reasoning in the LeetQuidity curriculum, or take the free calibration to see where your intuition breaks under time.

Take the calibrationView the curriculum

On this page

The coin has no memoryExpected flips to HH vs HTThe formula behind itStreaks & runsBiased coinsVariantsCommon mistakes

Related guides

Bayes Rule Interview QuestionsCoin Probability Interview QuestionsBiased Coin Interview QuestionsCoin Streak Probability Interview QuestionsBest Quant Interview Prep Platforms in 2026: An Honest ComparisonBest QuantGuide Alternatives in 2026
LeetQuidity

The complete quant interview course.

InstitutionsCurriculumPricingFAQCalibrationDemoGuides
XLinkedInInstagramYouTube

© 2026 LeetQuidity — a W Interior company. All rights reserved.

Privacy PolicyTerms of ServiceTrust & Security