Interview prep

26 probability interview questions, with answers.

Probability interview questions for data science and quant roles, with worked answers: conditional probability and Bayes, distributions, expectation, the classic puzzles, and where probability shows up in machine learning.

Probability questions test how you reason, so interviewers care more about your setup than the final number. Define the events, state your assumptions (independence, fair coins, how the information was revealed), then compute.

Several answers below are worked examples. Try them on paper first; the puzzles are classics precisely because intuition gets them wrong.

These 26 questions are free. SchoolWhool's Foundations of AI course places 650+ interview questions right after the lessons they test, with a mock interview with Gaurav. See also the machine learning interview questions.

Foundations

What's the difference between independent and mutually exclusive events?
Independent events don't affect each other: P(A and B) = P(A) × P(B). Mutually exclusive events can't happen together: P(A and B) = 0. Two events with non-zero probability can't be both, because if they're exclusive, knowing A happened tells you B didn't.
State the addition rule.
P(A or B) = P(A) + P(B) − P(A and B). You subtract the overlap so outcomes in both events aren't counted twice. For mutually exclusive events the overlap is zero.
How do you solve at-least-one problems?
Use the complement: P(at least one) = 1 − P(none). For example, the chance of at least one six in four rolls of a die is 1 − (5/6)⁴ ≈ 0.518. It's far easier than adding up every case.
What's the difference between permutations and combinations?
Permutations count ordered arrangements, n!/(n−k)!; combinations count unordered selections, n!/(k!(n−k)!). Choosing a committee of 3 from 10 people gives C(10, 3) = 120 ways; filling president, vice-president and secretary gives 10 × 9 × 8 = 720.
What's the difference between covariance and correlation?
Covariance measures how two variables move together, in the product of their units, so its size is hard to interpret. Correlation divides by both standard deviations, giving a value between −1 and 1. Zero correlation doesn't mean independence: if X is symmetric around zero, Y = X² is completely dependent on X but uncorrelated with it.

Conditional probability and Bayes

What is conditional probability?
P(A | B) = P(A and B) / P(B): the probability of A within the world where B happened. The common mistake is confusing P(A | B) with P(B | A); the probability of a positive test given disease is not the probability of disease given a positive test.
State Bayes' theorem and explain each term.
P(A | B) = P(B | A) × P(A) / P(B). P(A) is the prior, P(B | A) the likelihood of the evidence if A is true, P(B) the overall probability of the evidence, and P(A | B) the posterior: the updated belief after seeing the evidence.
A disease affects 1% of people. A test catches 99% of cases and has a 5% false-positive rate. You test positive. What's the chance you have the disease?
P(positive) = 0.99 × 0.01 + 0.05 × 0.99 = 0.0099 + 0.0495 = 0.0594. So P(disease | positive) = 0.0099 / 0.0594 ≈ 16.7%. Because the condition is rare, most positives are false positives. It's the same reason precision collapses for classifiers on rare events.
What is the law of total probability?
If events A₁, …, Aₙ split the outcomes into non-overlapping cases, then P(B) = Σ P(B | Aᵢ) × P(Aᵢ). It's how you compute the denominator in Bayes' theorem, and a useful way to break any problem into scenarios.
A family has two children, and at least one is a boy. What's the probability both are boys?
1/3: the equally likely families are BB, BG and GB, and only one of the three is BB. If you're told the older child is a boy, the answer is 1/2. The point interviewers look for is that the answer depends on exactly how the information was obtained, so state your assumption.

Random variables and distributions

What are a PMF, a PDF and a CDF?
A probability mass function gives P(X = x) for a discrete variable. A probability density function describes a continuous variable, where any exact value has probability zero and probabilities are areas under the curve. The cumulative distribution function, F(x) = P(X ≤ x), works for both.
What are the key properties of expectation and variance?
E[aX + b] = aE[X] + b, and E[X + Y] = E[X] + E[Y] always, even for dependent variables. Var(aX + b) = a²Var(X), and Var(X + Y) = Var(X) + Var(Y) + 2Cov(X, Y), so the variances only add when the variables are uncorrelated.
How many rolls of a fair die do you expect to need to get a six?
The number of rolls is geometric with p = 1/6, so the expected value is 1/p = 6. A common follow-up: the expected number of rolls to see all six faces is 6 × (1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6) = 14.7, the coupon collector problem.
When do you use the Bernoulli, binomial and Poisson distributions?
Bernoulli models one yes-or-no trial. Binomial(n, p) counts successes in n independent trials with the same p. Poisson(λ) counts events in a fixed interval at a constant average rate, and approximates the binomial when n is large and p small, with λ = np. A Poisson's mean equals its variance, which is a quick check on count data.
Why is the normal distribution so common?
Because of the central limit theorem: sums and averages of many independent effects tend towards a normal distribution. Roughly 68%, 95% and 99.7% of values fall within one, two and three standard deviations. But many real quantities, like income, waiting times and file sizes, are skewed or heavy-tailed, so check before assuming normality.
Explain the central limit theorem.
For independent, identically distributed variables with finite variance, the distribution of the sample mean approaches a normal distribution as n grows, centred on the true mean with standard deviation σ/√n, whatever the shape of the original distribution. It justifies most confidence intervals and tests. It fails for infinite-variance distributions, and heavily skewed data needs larger samples.
How does the law of large numbers differ from the central limit theorem?
The law of large numbers says the sample mean converges to the true mean as the sample grows. The central limit theorem describes the shape of the fluctuations around it: approximately normal, shrinking like 1/√n. The gambler's fallacy misreads the first: past results don't balance out; they're just diluted.
What does it mean that the exponential distribution is memoryless?
P(T > s + t | T > s) = P(T > t): if you've already waited s minutes, the remaining wait has the same distribution as a fresh one. The exponential models the time between events in a Poisson process; the geometric distribution is its discrete counterpart.

Classic puzzles

Explain the Monty Hall problem.
You pick one of three doors; the host, who knows where the car is, opens another door showing a goat and offers a switch. Switching wins with probability 2/3: your first pick is right only 1/3 of the time, and the host's choice concentrates the remaining 2/3 on the other closed door. The host's knowledge is the key; if he opened a door at random and happened to show a goat, switching would win half the time.
How many people do you need for a better-than-even chance that two share a birthday?
23. P(no shared birthday) = (365/365) × (364/365) × … × (343/365) ≈ 0.493, so the chance of a match is about 50.7%. The intuition is that 23 people form 253 pairs. The same maths explains hash collisions.
How do you get a fair result from a biased coin?
Flip it twice. Heads then tails counts as heads, tails then heads counts as tails, and on two of the same you flip again. It works because P(HT) = P(TH) = p(1 − p), whatever the bias; this is von Neumann's trick.
How do you pick one item uniformly at random from a stream of unknown length, in one pass?
Reservoir sampling: keep the first item, then replace the kept item with the k-th item with probability 1/k. By induction, every item seen so far is kept with equal probability. It extends to keeping k items, and it's a common data engineering interview question.

Probability in machine learning

Where does probability appear in classification models?
Logistic regression models P(y = 1 | x) through the sigmoid function; naive Bayes applies Bayes' theorem directly. Predicted probabilities combined with the costs of each error decide the threshold. If you use the probabilities as probabilities, check that they're calibrated.
What's the difference between maximum likelihood and MAP estimation?
Maximum likelihood picks the parameters that make the observed data most probable. MAP maximises the posterior, the likelihood times a prior. A Gaussian prior on the weights gives L2 (ridge) regularisation and a Laplace prior gives L1 (lasso). With lots of data, the two estimates converge.
Why is naive Bayes naive, and why does it still work?
It assumes features are independent given the class, which is rarely true. It still classifies well, especially text, because the ranking of class scores can be right even when the probabilities themselves are poorly calibrated, and it's fast and needs little data. Laplace smoothing avoids zero probabilities for unseen words.
What is a p-value, in probability terms?
The probability, assuming the null hypothesis is true, of getting data at least as extreme as what you observed. It's not the probability that the null is true, nor the probability that the result is due to chance. A small p-value only says the data would be surprising if the null were true.

First Principles, the SchoolWhool newsletter

One machine learning idea, explained properly, every week.

The intuition, the common mistake, and a five-minute way to try it yourself. Written by Gaurav.

Learn it properly, then the interview is the easy part.

Foundations of AI teaches probability and the rest of machine learning from first principles, with notebooks that check your work.