Quant interview prep guides

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: 365365365 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:

P(no match)=∏k=1n−1(1−k365)=365!365 n (365−n)!\Prob(\text{no match}) = \prod_{k=1}^{n-1}\left(1 - \frac{k}{365}\right) = \frac{365!}{365^{\,n}\,(365-n)!}P(no match)=k=1∏n−1​(1−365k​)=365n(365−n)!365!​

Then P(match)=1−P(no match)\Prob(\text{match}) = 1 - \Prob(\text{no match})P(match)=1−P(no match). Plug in n=23n = 23n=23 and the product lands at 0.49270.49270.4927, so the match probability is 50.7%. One person short, at n=22n = 22n=22, it’s 47.6% — under even odds. Twenty-three is genuinely the smallest group that tips past a half.

Probability of no shared birthday, by group sizeAs group size grows from 1 to 25, the probability that all birthdays are distinct falls from 100% to 43%, dropping below 50% at 23 people.P(ALL BIRTHDAYS DISTINCT)50%100.0%197.3%588.3%1074.7%1558.9%2049.3%2343.1%25number of peoplea match becomesmore likely than not
Each column is the probability that everyone’s birthday is distinct. It slides under 50% for the first time at 23 people — the moment a shared birthday becomes more likely than not. n = 23 → 49.3% distinct → 50.7% match.

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:

(n2)=n(n−1)2  ⇒  (232)=253\binom{n}{2} = \frac{n(n-1)}{2} \;\Rightarrow\; \binom{23}{2} = 253(2n​)=2n(n−1)​⇒(223​)=253

Two hundred fifty-three pairs, each a 1/3651/3651/365 chance of matching. The expected number of matching pairs is 253/365=0.6931253/365 = 0.6931253/365=0.6931 — not coincidentally, that’s ln⁡2\ln 2ln2. 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 n2n^2n2.

Pair counts and the two birthday questions at 23 peopleFive people make 10 pairs, ten make 45, and twenty-three make 253. At 23 people the probability any two share a birthday is 50.7% while the probability someone shares your birthday is 6.1%.PAIRS = n(n−1)/25 people→10 pairs10 people→45 pairs23 people→253 pairseach pair is a 1/365 shot — 253 shots at 23 peopleAT 23 PEOPLEAny two people match50.7%Someone matches YOU6.1%253 pairs1 target
Left: the pair count (n2)\binom{n}{2}(2n​) grows quadratically — 23 people already make 253 pairs. Right: at 23 people, the chance some pair matches (50.7%) dwarfs the chance someone matches your birthday (6.1%). Different question, different denominator.

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 λ=(n2)/365\lambda = \binom{n}{2}/365λ=(2n​)/365 — so:

P(match)≈1−e−(n2)/365≈1−e−n2/(2⋅365)\Prob(\text{match}) \approx 1 - e^{-\binom{n}{2}/365} \approx 1 - e^{-n^2 / (2\cdot 365)}P(match)≈1−e−(2n​)/365≈1−e−n2/(2⋅365)

At n=23n = 23n=23, the exponent is −253/365=−ln⁡2-253/365 = -\ln 2−253/365=−ln2, giving exactly 1−12=0.5001 - \tfrac12 = 0.5001−21​=0.500 — the approximation nails the real 50.7%. Inverting it gives the rule worth memorizing: to reach even odds among ddd equally likely days you need about n≈1.177dn \approx 1.177\sqrt{d}n≈1.177d​, where 1.177=2ln⁡21.177 = \sqrt{2\ln 2}1.177=2ln2​. For d=365d = 365d=365 that’s 1.177365≈22.51.177\sqrt{365} \approx 22.51.177365​≈22.5, i.e. 23. The same d\sqrt{d}d​ scaling is exactly the hash-collision / birthday-attack estimate interviewers in crypto and systems roles are really after.

Probability of at least one shared birthday versus group sizeThe probability of a shared birthday rises from near zero, passes 50% at 23 people, reaches 97% at 50, and 99% at 57.P(AT LEAST ONE SHARED BIRTHDAY)0%50%100%0102030405060number of people23 people50.7% — just past even
The same numbers as a curve. It crosses 50% at 23, then flattens into near-certainty: 97.0% at 50, 99.0% at 57, 99.92% at 70. Steep where it matters, then boring — the signature of a probability driven by a growing pair count.

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:

P(someone matches you)=1−(364365)n\Prob(\text{someone matches you}) = 1 - \left(\tfrac{364}{365}\right)^{n}P(someone matches you)=1−(365364​)n

With n=23n = 23n=23 that’s 1−(364/365)23≈6.1%1 - (364/365)^{23} \approx 6.1\%1−(364/365)23≈6.1%. To get even odds on your specific birthday you need roughly 365ln⁡2≈253365\ln 2 \approx 253365ln2≈253 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 ddd and hash collisions. Swap 365 for any ddd and the even-odds threshold is ≈1.177d\approx 1.177\sqrt{d}≈1.177d​. This is why a 64-bit hash collides around 2322^{32}232 items, not 2642^{64}264.
  • Triple birthdays. If they ask for three people sharing a day, the threshold jumps to about 888888 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 1/3651/3651/365” gives 0.69, which people quote as 69%. That’s an expected count, not a probability — at n=30n = 30n=30 the same sum is 435/365=1.19>1435/365 = 1.19 > 1435/365=1.19>1, which should end the argument. Use it inside 1−e−λ1 - e^{-\lambda}1−e−λ 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 d\sqrt{d}d​ 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.

Take the calibrationView the curriculum

On this page

What’s being testedWork the complementCount the pairsThe approximationThe “my birthday” trapAssumptions & variantsCommon mistakes

Related guides

Bayes Rule Interview QuestionsProbability Brainteasers Quant Interview GuideApproximation Math for Quant InterviewsProbability Interview Questions for Quant RolesQuant Interview Cheat Sheet: Formulas, Identities and Fast MethodsQuant Interview Drills by Topic
LeetQuidity

The complete quant interview course.

InstitutionsCurriculumPricingFAQCalibrationDemoGuides
XLinkedInInstagramYouTube

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

Privacy PolicyTerms of ServiceTrust & Security