Data ScienceInterview question banks

Probability puzzles from analytics interviews, solved and simulated

PK
Pankit Kumar
Sr. Data Scientist at Parexel (a Goldman Sachs–backed company) · 27 September 2026 · 6 min read
In this article (3 sections)

Related programme: the Data Science course (6 months; ₹1,30,000 (inclusive of GST) · EMI from ₹5,000/month).

The short answer

Probability puzzles in analytics interviews are short problems — dice, cards, birthdays, alerts — that test four moves: counting outcomes carefully, using the complement ("at least one" is one minus "none"), conditioning on the right information, and computing expected values. Below are ten puzzles that recur, each with the exact reasoning you would say aloud, followed by one Python script that simulates all ten so you can confirm every answer yourself.

The puzzles and their exact answers

1. Two fair dice are rolled. What is the probability the sum is 7?

Six of the 36 equally likely ordered pairs sum to 7: (1,6), (2,5), (3,4), (4,3), (5,2), (6,1). So 6/36 = 1/6. Tests: counting ordered outcomes, not unordered ones.

2. What is the probability of at least one six in four rolls of a die?

Complement: probability of no six in four rolls is (5/6)⁴ ≈ 0.482, so at least one six is about 0.518. Tests: reaching for the complement instead of adding cases, which double-counts.

3. In a room of 23 people, what is the probability that two share a birthday?

Ignore leap years and assume equally likely birthdays. The probability all 23 differ is (365/365)(364/365)…(343/365) ≈ 0.493, so a shared birthday has probability about 0.507. Tests: the complement again, and not confusing "any pair matches" with "someone matches me", which is much less likely.

4. A family has two children and at least one is a boy. What is the probability both are boys?

Equally likely families: BB, BG, GB, GG. Knowing at least one boy removes GG, leaving three, of which one is BB. Answer 1/3. If instead you are told the elder child is a boy, the answer is 1/2. Tests: precisely what information you are conditioning on. Say the assumption out loud.

5. One transaction in a hundred is fraud. A model flags 95% of fraud and wrongly flags 10% of genuine transactions. A transaction is flagged. What is the chance it is fraud?

Bayes, with counts per 10,000 transactions: 100 fraud, of which 95 flagged; 9,900 genuine, of which 990 flagged. Flagged total 1,085, fraud among them 95. Probability ≈ 95/1,085 ≈ 0.088, under 9%. Tests: base-rate reasoning. This is the most practically important puzzle in the list, because it is exactly how alert precision behaves in real fraud, credit and medical work.

6. How many rolls on average until the first six?

A geometric distribution with success probability 1/6 has mean 1/p = 6 rolls. Tests: recognising a standard distribution rather than summing a series by hand — though you can derive it by noting E = 1 + (5/6)E.

7. A snack brand puts one of five collectible cards in each packet, all equally likely. How many packets on average to collect all five?

The coupon-collector problem. Once you have k different cards, the chance the next packet is new is (5−k)/5, so the expected wait is 5/(5−k). Summing for k = 0 to 4 gives 5 × (1 + 1/2 + 1/3 + 1/4 + 1/5) ≈ 11.42 packets. Tests: breaking a process into stages, each with its own expected waiting time.

8. The Monty Hall problem: you pick one of three doors, the host (who knows) opens a different door with a goat and offers a switch. Switch?

Yes. Your first pick is right with probability 1/3; the host's action does not change that. Switching wins whenever your first pick was wrong, which is 2/3 of the time. Tests: whether you account for the host's knowledge — if the host opened a door at random and happened to reveal a goat, the answer becomes 1/2.

9. A stick is broken at two uniformly random points. What is the probability the three pieces form a triangle?

The pieces form a triangle when no piece is longer than half the stick. Geometric argument on the unit square of break points gives 1/4. Tests: translating a condition into a region and computing its area — a good test of calm under an unfamiliar problem.

10. Two dice are rolled. What is the expected value of the larger number?

P(max ≤ k) = (k/6)², so P(max = k) = (k² − (k−1)²)/36 = (2k − 1)/36. The expectation is Σ k(2k−1)/36 for k = 1 to 6 = 161/36 ≈ 4.47. Tests: using the cumulative distribution to get a distribution of a maximum, a trick that returns in order-statistics questions.

One script that checks all ten

python
import random
from math import prod

random.seed(42)
N = 200_000
d = lambda: random.randint(1, 6)

sim = {}
sim[1] = sum(d() + d() == 7 for _ in range(N)) / N
sim[2] = sum(any(d() == 6 for _ in range(4)) for _ in range(N)) / N
sim[3] = sum(len(set(random.randint(1, 365) for _ in range(23))) < 23 for _ in range(N // 4)) / (N // 4)

boys = both = 0
for _ in range(N):
    kids = [random.choice("BG"), random.choice("BG")]
    if "B" in kids:
        boys += 1
        both += kids == ["B", "B"]
sim[4] = both / boys

flag = fraud_and_flag = 0
for _ in range(N):
    fraud = random.random() < 0.01
    flagged = random.random() < (0.95 if fraud else 0.10)
    flag += flagged
    fraud_and_flag += fraud and flagged
sim[5] = fraud_and_flag / flag

def rolls_to_six():
    n = 1
    while d() != 6:
        n += 1
    return n
sim[6] = sum(rolls_to_six() for _ in range(N)) / N

def packets():
    seen, n = set(), 0
    while len(seen) < 5:
        seen.add(random.randint(1, 5)); n += 1
    return n
sim[7] = sum(packets() for _ in range(N)) / N

wins = 0
for _ in range(N):
    car, pick = random.randrange(3), random.randrange(3)
    opened = next(x for x in range(3) if x != pick and x != car)
    switched = next(x for x in range(3) if x != pick and x != opened)
    wins += switched == car
sim[8] = wins / N

def triangle():
    a, b = sorted((random.random(), random.random()))
    return max(a, b - a, 1 - b) < 0.5
sim[9] = sum(triangle() for _ in range(N)) / N
sim[10] = sum(max(d(), d()) for _ in range(N)) / N

exact = {1: 1/6, 2: 1 - (5/6)**4, 3: 1 - prod((365 - i) / 365 for i in range(23)),
         4: 1/3, 5: 95/1085, 6: 6, 7: 5 * sum(1/k for k in range(1, 6)),
         8: 2/3, 9: 1/4, 10: 161/36}
for k in exact:
    print(f"puzzle {k:>2}: exact {exact[k]:.4f}   simulated {sim[k]:.4f}")

Every simulated value lands within simulation noise of the exact one. If one of yours does not, the error is almost always in the setup — in puzzle 8, for example, letting the host open the car door by mistake changes the answer.

How to answer when you are stuck

Interviewers rarely expect instant answers to puzzles 9 and 10. What they score is the process: restate the problem, name the assumption (fair die, independent events, equally likely birthdays), try a small case, look for a complement or a symmetry, and sanity-check the final number — a probability above 1 or an expected maximum below 3.5 is wrong on its face. Saying "I'd confirm this with a quick simulation" is itself a good signal.

Puzzle 5 is the bridge to real work: the same arithmetic appears when you evaluate a classifier's precision on rare events, covered in the model evaluation metrics question bank. Probability and statistics underpin the modelling modules of the Data Science programme.

Frequently asked questions

Why do analytics interviews ask probability puzzles?

They test whether you can break an unfamiliar problem into cases, use the complement rule, and apply conditional probability correctly. Those are the same moves needed to reason about fraud alerts, conversion funnels and test results, which is why interviewers use puzzles as a quick proxy.

Should I simulate or solve exactly in the interview?

Solve exactly on the whiteboard, and mention that you would check the answer with a quick simulation. Simulation catches errors in case-counting, and saying so shows a habit of verifying your own reasoning.

PK
Pankit Kumar
Lead Instructor, NeuraPath Academy

Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.

This article is part of our Data Science programme — 6 months. From data foundations to machine learning, deep learning and deployment.

Explore Data Science
Counselling is free · no obligation

Not sure which programme fits?

Tell us your background and we will map it to the right entry point — including saying so when a cheaper programme is the better fit. A counsellor replies within one working day.