The birthday paradox, for quant interviews
Twenty-three people, even odds of a shared birthday. The number surprises everyone once. Interviewers want to see whether you can rebuild it — cleanly, from the complement — and whether you know why it isn’t the question people think it is.
For candidates practicing complements, approximation, and collision probabilities · Updated July 21, 2026
What the question is testing
“In a room of 23 people, what’s the chance two share a birthday?” The interviewer is not impressed that you remember the answer is about a half. They are watching for three moves: that you attack the complement instead of the messy union, that you understand the count that actually drives the surprise, and that you can approximate the answer without a calculator. Get those and the exact number falls out; miss them and you’re stuck adding up overlapping events.
Fix the model first: equally likely birthdays, people independent, no leap days. State those assumptions out loud — they are the parts an interviewer can perturb later.
Work the complement
Computing “at least one shared birthday” head-on means a union over every pair — inclusion–exclusion hell. The complement is a clean product. Seat people one at a time; each new person must dodge all the birthdays already taken:
Then . Plug in and the product lands at , so the match probability is 50.7%. One person short, at , it’s 47.6% — under even odds. Twenty-three is genuinely the smallest group that tips past a half.
Why so few? Count the pairs
The whole “paradox” is a miscount. People imagine 23 birthdays racing against 365 days and expect a tiny number. But a match is about pairs of people, and pairs grow quadratically:
Two hundred fifty-three pairs, each a chance of matching. The expected number of matching pairs is — not coincidentally, that’s . Once you have on the order of one expected collision, “at least one” is a coin flip. The people scale linearly; the opportunities scale like .
The approximation to keep in your head
On a whiteboard you don’t evaluate a 23-term product. Treat the pair matches as rare and roughly independent — a Poisson count with mean — so:
At , the exponent is , giving exactly — the approximation nails the real 50.7%. Inverting it gives the rule worth memorizing: to reach even odds among equally likely days you need about , where . For that’s , i.e. 23. The same scaling is exactly the hash-collision / birthday-attack estimate interviewers in crypto and systems roles are really after.
The trap: “shares my birthday”
A favourite follow-up: “so with 22 other people, is there a good chance someone shares your birthday?” This is a different question, and the honest answer is no. Now there is a single target date, not 253 free-floating pairs:
With that’s . To get even odds on your specific birthday you need roughly people. The gap between 6.1% and 50.7% at the same group size is the entire lesson: the surprise comes from any pair matching, not a fixed one.
Assumptions and variants
- Non-uniform birthdays. Real birthdays cluster (September peaks, almost no Feb 29s). Uniformity actually minimizes the collision probability, so any real-world skew only raises the match chance — meaning 23 is a conservative, upper-bound count for reaching 50%. You can assert this without recomputing.
- General and hash collisions. Swap 365 for any and the even-odds threshold is . This is why a 64-bit hash collides around items, not .
- Triple birthdays. If they ask for three people sharing a day, the threshold jumps to about people. Flag it as a known result rather than deriving it live — the naive Poisson shortcut understates it, and the whiteboard version isn’t worth the time.
Common mistakes
- Adding pair probabilities. “253 pairs times ” gives 0.69, which people quote as 69%. That’s an expected count, not a probability — at the same sum is , which should end the argument. Use it inside instead.
- Answering the wrong question. Confusing “any two match” (50.7%) with “someone matches me” (6.1%). Always pin down whether the target birthday is fixed.
- Fighting the union head-on. Inclusion–exclusion over 253 events is correct and hopeless. Reaching for the complement first is the signal the interviewer is grading.
Practice the pattern
The birthday problem is the canonical “work the complement, then approximate” question — and the collision scaling shows up everywhere from hashing to matching trades. Drill complements, Poisson approximations, and collision estimates in the LeetQuidity curriculum, or take the free calibration to see where your reasoning breaks under time.