Statistics
Source: Concepts adapted from Ace the Data Science Interview — Chapter 6 (“Statistics”) by Kevin Huo & Nick Singh. Rewritten in original wording for this course.
Statistics is the language of A/B tests, uncertainty, and “is this lift real?” Interviewers start with LLN/CLT, then p-values, confidence intervals, Type I/II errors, and sometimes MLE/MAP. Each section below has an explorer, a concept quiz, and a compute story quiz (≤2 decimals; use New story).
Expectation, variance, and standard deviation
For a random variable with density/mass :
Standard deviation . Conditional expectation uses the conditional density. Covariance and correlation:
Moments & correlation
1 / 4Var(X) is always…
Pick an answer to see if you are right.
Compute: expectation & variance
1 / 3A user converts (X=1) with probability 0.2, else X=0. What is Var(X)? Round to 2 decimals.
Enter a number (at most 2 decimal places).
Compute: correlation
1 / 2Cov(X,Y)=1, SD(X)=4, SD(Y)=4. What is the correlation ρ? Round to 2 decimals.
Enter a number (at most 2 decimal places).
Uniform moments (interview derivation target)
If :
You should be able to re-derive these from the PDF when asked.
Uniform moments
1 / 2For Uniform(0, 6), E[X] equals…
Pick an answer to see if you are right.
Compute: Uniform E / Var
1 / 3X ~ Uniform(2, 11). What is Var(X)? Round to 2 decimals.
Enter a number (at most 2 decimal places).
Law of Large Numbers
Independently sample from the same distribution. The sample mean converges to as . Short streaks (five heads) do not contradict LLN — long-run averages do.
Law of Large Numbers
1 / 3LLN says that as n grows, the sample mean…
Pick an answer to see if you are right.
Central Limit Theorem
For large , is approximately Normal with mean and variance , even if itself is not Normal:
CLT underwrites most z-tests and A/B proportion tests.
Central Limit Theorem
1 / 4CLT is about the distribution of…
Pick an answer to see if you are right.
Compute: SE and z
1 / 3Scores have σ=5. You average n=64 independent scores. What is the standard error of the sample mean (σ/√n)? Round to 2 decimals.
Enter a number (at most 2 decimal places).
Hypothesis testing
- State (baseline) and (what you hope to support).
- Compute a test statistic under → p-value.
- Compare to significance level . Reject if . Failing to reject is not proof is true.
One-sided: vs (or ).
Two-sided: .
A/B testing is hypothesis testing on product metrics (e.g. equal conversion rates vs uplift).
Test statistics
| Test | Use when |
|---|---|
| Z | Large (CLT) or known |
| t | Small , unknown (use , df ) |
| χ² | Goodness of fit / independence in contingency tables |
Proportions and A/B
Members are Bernoulli; is a mean. Under :
Two-sample A/B uses a pooled SE for . Always name the statistic and that CLT justifies Normality for large .
Hypothesis tests
1 / 5Order the usual hypothesis-testing workflow (top = first).
OrderDrag the handle to rearrange — top should be first.
- 1Compare p to α; reject or fail to reject H₀
- 2State H₀ and H₁
- 3Compute the test statistic and p-value under H₀
Drag items into the correct order (or use ↑↓), then check.
Compute: χ²
1 / 2Under H₀ three categories are equally likely. Observed counts are 25, 40, 22. What is χ² = Σ(O−E)²/E? Round to 2 decimals.
Enter a number (at most 2 decimal places).
Compute: A/B z
1 / 3A/B test: control 150/1000 conversions, treatment 190/1000. Using the pooled two-proportion z-statistic, what is z? Round to 2 decimals.
Enter a number (at most 2 decimal places).
p-values and confidence intervals
A p-value is the probability, under , of a test statistic at least as extreme as observed. Small → data are surprising under .
A confidence interval is a random interval that covers the true parameter in of repeated samples. For a mean with known :
For a proportion: . If the null value (e.g. 0 lift) lies inside the CI, you typically do not reject .
p-values & CIs
1 / 3A p-value is computed assuming…
Pick an answer to see if you are right.
Compute: CI endpoint
1 / 3x̄=10, σ=4, n=49. What is the lower endpoint of a 95% CI for μ (use z=1.96)? Round to 2 decimals.
Enter a number (at most 2 decimal places).
Type I / II errors, power, Bonferroni
| Reject | Fail to reject | |
|---|---|---|
| true | Type I (false positive), rate | Correct |
| false | Correct (power ) | Type II (false negative), rate |
Larger generally raises power. For tests at family-wise , Bonferroni uses per-test so you do not expect false positives by chance.
Errors & multiple testing
1 / 5Type I error means…
Pick an answer to see if you are right.
Compute: Bonferroni & power
1 / 3A test has Type II error rate β=0.3. What is its power (1−β)? Round to 2 decimals.
Enter a number (at most 2 decimal places).
MLE and MAP
MLE: with . Work with .
MAP: maximize prior × likelihood: .
Classic drill: Bernoulli MLE is ; Normal mean MLE is the sample mean.
MLE & MAP
1 / 2We maximize log-likelihood because…
Pick an answer to see if you are right.
Compute: Bernoulli MLE
1 / 3You observe 13 successes in 20 i.i.d. Bernoulli trials. What is the MLE of p? Round to 2 decimals.
Enter a number (at most 2 decimal places).
Interview checklist
- Moments: , Var, , Cov,
- Uniform (and friends): re-derive / Var when asked
- LLN → long-run averages; CLT → ≈ Normal, SE
- Hypothesis test steps; Z vs t vs χ²; A/B = proportion z + CLT
- Explain p-value and CI in plain language
- Type I/II, power, Bonferroni for many metrics
- MLE (log-likelihood) vs MAP (prior)