State the data grain, assumptions, metric, leakage or failure risk, and how you would validate the result before discussing tools.
Question set
11 detailed answers
01How do mean, median, and mode differ, and why is the median better for skewed data (income, latency)?
junior
Short answer: The mean is the sum divided by the count and is sensitive to outliers. The median is the middle value of the ordered data and is robust to outliers. The mode is the most frequent value. For skewed data the median better reflects the "typical" observation.
In depth:
- Mean — good for symmetric data and downstream math (variance, regression), but a single outlier shifts it.
- Median — the 50th percentile; splits the data in half and barely reacts to extremes.
- Mode — the only one of the three that works for categorical data ("most common plan").
| Metric | When to use | Outlier sensitivity |
|---|---|---|
| Mean | symmetric data, downstream calculations | high |
| Median | skewed data: income, latency, prices | low |
| Mode | categorical data, most frequent value | low |
⚠️ Common mistake: reporting the mean for income or latency. A long right tail drags the mean upward, so it no longer describes the typical user — use the median.
02What do variance and standard deviation measure, and why does comparing groups require more than the mean?
middle
Short answer: Variance is the average squared deviation from the mean; standard deviation is its square root, in the same units as the data. Two groups with the same mean can differ wildly in spread, so the mean alone is not enough.
In depth:
- Variance (σ²) — how far values scatter around the mean; in squared units.
- Standard deviation (σ) — the square root of variance, in original units, so it is easier to interpret.
- Sample estimate — dividing by n−1 (Bessel's correction,
ddof=1) gives an unbiased estimate of the population variance. - Why it matters for groups — equal means can hide different stability (risk, reliability).
import numpy as np
a = [50, 50, 50, 50] # mean 50, no spread
b = [10, 30, 70, 90] # mean 50, large spread
np.mean(a), np.mean(b) # (50.0, 50.0)
np.std(a, ddof=1), np.std(b, ddof=1) # (0.0, 36.5) ← ddof=1: divide by n-1
⚠️ Common mistake: comparing groups by the mean only. The same mean with different standard deviations means completely different metric behavior.
03What is the normal distribution and the 68-95-99.7 rule? How do skew and heavy tails affect summary statistics?
middle
Short answer: The normal (Gaussian) distribution is symmetric and bell-shaped. About 68% of values fall within ±1σ of the mean, ~95% within ±2σ, and ~99.7% within ±3σ. Under skew the mean drifts toward the long tail, and the median becomes more reliable.
In depth:
- Symmetry — for a perfect normal, mean = median = mode.
- The 68-95-99.7 rule — sets what share of data falls near the mean and underpins z-scores.
- Skew — a right tail (income, revenue) pulls the mean rightward: mean > median.
- Heavy tails (kurtosis) — more extreme values than the normal predicts; the 3σ rule underestimates risk.
.-^^^-.
.' | '. normal curve
/ | \
| 68% ◀-+-▶ |
95% ◀-----+-----▶
99.7% ◀-------+-------▶
-3σ -2σ -1σ μ +1σ +2σ +3σ
⚠️ Common mistake: assuming all data is normal. Income, latency, and revenue are usually skewed — check the distribution (histogram, Q-Q plot) before applying normal-curve rules.
04State the Central Limit Theorem and explain why it lets us do inference from sample means. How does standard deviation differ from standard error?
senior
Short answer: The CLT says the distribution of the sample mean approaches a normal distribution as the sample size n grows, regardless of the shape of the original distribution (given finite variance). This is what lets us build confidence intervals and test hypotheses about the mean. Standard deviation (σ) describes the spread of individual observations, while standard error (SE = σ/√n) describes the spread of the sample mean.
In depth:
- What the CLT claims — even for skewed data, the distribution of the mean across many samples is ≈ normal.
- Conditions — independent observations, finite variance, large enough n (often n ≥ 30 as a rule of thumb).
- σ vs SE — σ does not depend on n; SE shrinks as the sample grows.
- Consequence — precision of the mean improves as √n: to halve the interval you need 4× the data.
σ = spread of individual observations (independent of n)
SE = σ / √n ← spread of the mean, shrinks as the sample grows
n=100 → SE = σ/10; to halve SE → need 4× observations
⚠️ Common mistake: thinking the CLT makes the data itself normal. It is the distribution of the sample mean that becomes normal, not the underlying variable.
05How does hypothesis testing work: null vs alternative hypotheses, the significance level α, and what a p-value really means (and doesn't)?
senior
Short answer: The null hypothesis (H₀) says "no effect"; the alternative (H₁) says "there is an effect." The p-value is the probability of getting data at least as extreme as observed, ASSUMING H₀ is true. If p < α (usually 0.05), H₀ is rejected.
In depth:
- H₀ and H₁ — stated before collecting data; the test looks for grounds to reject H₀.
- Significance level α — a pre-chosen threshold and the tolerated probability of a Type I error.
- p-value — P(data this extreme | H₀ true), nothing more.
- Decision — p < α → reject H₀; otherwise "insufficient evidence" (not "H₀ is proven").
distribution of the statistic under H₀
.-^^^-.
.' '.
/ \▓▓▓ ← p-value = tail area
----+-------------+-▲-- ▲ = observed value
p < α → reject H₀
⚠️ Common mistake: the p-value is NOT the probability that H₀ is true, and NOT the probability the result is "due to chance." It is P(data | H₀), not P(H₀ | data).
06What is the difference between Type I and Type II errors, what is statistical power, and how are they related?
senior
Short answer: A Type I error (α) is rejecting a true H₀ (a false positive). A Type II error (β) is failing to reject a false H₀ (a false negative). Power = 1 − β is the probability of detecting an effect that truly exists. At a fixed sample size, lowering α raises β.
In depth:
- Type I error (α) — "seeing an effect that isn't there"; controlled by the choice of α.
- Type II error (β) — "missing a real effect."
- Power (1 − β) — grows with effect size, sample size, and α.
- Trade-off — at the same n, lowering α raises β; both errors fall by increasing the sample.
| H₀ true | H₀ false | |
|---|---|---|
| Rejected H₀ | Type I error (α) | Correct — power (1−β) |
| Failed to reject H₀ | Correct (1−α) | Type II error (β) |
⚠️ Common mistake: fighting only false positives by lowering α and forgetting it inflates β. To reduce both errors at once, increase the sample size.
07How do you correctly interpret a 95% confidence interval, and why is it more informative than a point estimate?
middle
Short answer: A 95% confidence interval is an interval produced by a procedure that, over repeated sampling, captures the true parameter value 95% of the time. It shows not just the estimate but its uncertainty (its width), which a point estimate cannot.
In depth:
- Correct interpretation — a statement about the procedure / long-run frequency, not about the one interval you computed.
- Width — a narrow CI = high precision; it depends on the standard error and sample size n.
- Link to testing — if a 95% CI for a difference excludes 0, the effect is significant at α = 0.05.
from scipy import stats
import numpy as np
data = np.array([4.1, 5.2, 3.8, 6.0, 4.7, 5.5])
# 95% CI for the mean (t-distribution, small sample)
stats.t.interval(0.95, df=len(data)-1,
loc=data.mean(),
scale=stats.sem(data)) # (4.00, 5.77)
⚠️ Common mistake: saying "there is a 95% probability the true value lies in this interval." The parameter is fixed; the procedure is random. 95% is the share of intervals that capture the truth under repetition.
08What is the difference between correlation and causation? What does the coefficient r show, and where do confounders and Simpson's paradox come in?
middle
Short answer: Correlation measures the strength and direction of a linear relationship (the coefficient r ranges from −1 to +1) but does not prove causation. An observed association can be explained by a hidden confounder, reverse causation, or chance.
In depth:
- Coefficient r — near ±1 = strong linear relationship; r = 0 means no LINEAR relationship (a nonlinear one may still exist).
- Why ≠ causation — a confounder (common cause), reverse causation, or coincidence.
- Simpson's paradox — the direction of an association in the aggregate can flip within subgroups.
- Getting closer to causation — a randomized experiment (A/B test) or controlling for confounders.
| r | Interpretation |
|---|---|
| +1 | perfect positive linear relationship |
| 0 | no linear relationship (nonlinear possible) |
| −1 | perfect negative linear relationship |
⚠️ Common mistake: inferring cause from an observational correlation. Ice-cream sales and drownings correlate, but the cause is hot weather (a confounder), not ice cream.
09How should an analyst interpret coefficients and R² in linear regression, and what key assumptions and pitfalls must they keep in mind?
senior
Short answer: A predictor's coefficient shows how much the response changes on average when that predictor rises by 1 unit, holding the others constant. R² is the share of the response's variance explained by the model (0 to 1). Linear regression requires linearity, independent residuals, and constant residual variance.
In depth:
- Coefficients (β) — the slope; the sign gives direction, the magnitude gives the effect size "all else equal."
- R² — the fraction of variance explained; a high R² ≠ a good or causal model.
- Assumptions — linearity, independent residuals, homoscedasticity, approximately normal residuals.
- Pitfalls — multicollinearity (unstable coefficients), extrapolation beyond the data range, outliers.
| Concept | What it means | Trap |
|---|---|---|
| β (coefficient) | change in y per +1 unit of x, all else equal | confusing it with causation |
| R² | fraction of variance explained | rises when you add any predictors |
| Multicollinearity | predictors correlated with each other | unstable, uninterpretable β |
⚠️ Common mistake: chasing a high R² by adding predictors. Use adjusted R² and inspect the residuals — a high R² guarantees neither validity nor causation.
10How do you choose a statistical test — t-test vs z-test vs chi-square — what does each compare and when do you reach for which?
middle
Short answer: A t-test compares means with a small sample and unknown σ; a z-test compares means or proportions with a large sample and known σ; a chi-square test checks for an association between categorical variables using frequencies.
In depth:
- t-test — one-sample, two-sample, or paired; for numeric data when the population σ is unknown.
- z-test — rare in practice for means (σ is usually unknown), but it is the basis for proportion tests and large samples.
- Chi-square — goodness-of-fit and independence tests; works on contingency tables.
| Test | What it compares | When to use |
|---|---|---|
| t-test | means of 1–2 groups | numeric data, small sample (n<30), σ unknown |
| z-test | means or proportions | large sample (n≥30), σ known |
| Chi-square | category frequencies | categorical data, contingency tables |
⚠️ Common mistake: applying a t- or z-test to categorical frequencies, or chi-square to means. First identify the data type (numeric vs categorical) and the number of groups.
11What sampling methods exist (random, stratified) and which systematic biases (selection, survivorship, response) wreck analyses?
middle
Short answer: A good sample is representative of the population. Random sampling gives everyone an equal chance of selection; stratified sampling splits the population into subgroups and draws from each. Bias arises when the sample systematically differs from the population.
In depth:
- Random — equal chance for all; the baseline standard of representativeness.
- Stratified — selection proportional to subgroups; more precise for heterogeneous populations.
- Cluster — pick whole groups (stores, cities); cheaper but coarser.
| Bias | What it is | Example |
|---|---|---|
| Selection bias | the sample is not representative | surveying only active users |
| Survivorship bias | you see only the "survivors" | analyzing only profitable companies |
| Response bias | not everyone replies / replies dishonestly | reviews left only by the delighted and the furious |
⚠️ Common mistake: assuming a large sample is automatically good. A biased sample of a million is worse than a small random one — size does not cure systematic error (the 1936 Literary Digest poll failure).
Source notes
References and review policy
RecallDeck’s interview answers are editorial material, reviewed against maintained official documentation where a primary reference is available. Tool selections use direct provider links and contain no affiliate placements. Features can change after the review date.
From reading to recall
Practice the full interview loop.
RecallDeck schedules the concepts you miss and keeps coding, design, and behavioral fundamentals available when the interviewer changes direction.