Statistics for Data Science Interview Questions and Answers
Last updated 2026-11-19
Statistics rounds check whether you can reason about uncertainty, not whether you can recite definitions. Interviewers give you a small dataset or a scenario and ask for a confidence interval, a test statistic or a sample size. They then ask what the number means, which is where most candidates slip, especially on p-values and confidence intervals.
Each answer below is computed step by step so you can check your own working. Probability questions such as Bayes rule and expectations have their own page, probability for data science interview questions, and experiment design is covered in A/B testing interview questions.
| Typical rounds | Statistics questions with calculations, case on test design |
|---|---|
| Core skills | Inference, hypothesis testing, regression, sampling |
| Questions here | 14 worked questions |
Formulas to know without looking
- Standard error of the mean: s divided by the square root of n.
- Confidence interval: estimate plus or minus critical value times standard error.
- z statistic: (observed - hypothesised) divided by standard error.
- Chi-square: sum of (observed - expected) squared divided by expected.
- R squared: 1 minus residual sum of squares over total sum of squares.
Interpretation traps
A 95 percent confidence interval does not mean there is a 95 percent chance that the true value lies in the one interval you computed; it means that 95 percent of intervals built this way would contain it. A small p-value does not measure effect size, and a non-significant result does not prove no effect. Say these plainly and you will stand out.
Statistics for Data Science Interview Questions and Answers: questions with worked answers
1 Population versus sample standard deviation: compute both for 2, 4, 4, 4, 5, 5, 7, 9.
easyThe mean is 40 / 8 = 5. Squared deviations are 9, 1, 1, 1, 0, 0, 4, 16, which sum to 32. Population variance is 32 / 8 = 4, so the standard deviation is 2. Sample variance divides by n - 1 = 7, giving 4.571 and a standard deviation of 2.138. Dividing by n - 1 (Bessel's correction) corrects the bias that arises because deviations are measured from the sample mean, which is closer to the data than the true mean. NumPy defaults to ddof=0 and pandas to ddof=1.
2 State the central limit theorem and compute a standard error: sigma = 20, n = 100.
easyFor independent observations with finite variance, the distribution of the sample mean approaches a normal distribution as n grows, whatever the shape of the original data, with mean mu and standard deviation sigma / sqrt(n). Here the standard error is 20 / 10 = 2. To halve it you need four times the sample, 400 observations. The theorem is why z and t procedures work on non-normal data once n is reasonably large, though heavily skewed data may need several dozen observations or more.
3 Compute a 95 percent confidence interval: sample mean 50, standard deviation 10, n = 25.
mediumThe standard error is 10 / sqrt(25) = 2. With an unknown population variance and a small n, use the t distribution with 24 degrees of freedom; the critical value is 2.064. The margin is 2.064 x 2 = 4.13, so the interval is 45.87 to 54.13. The z value 1.96 would give 46.08 to 53.92, slightly too narrow for this sample size. A wider interval comes from higher confidence, more variability or a smaller sample.
pythonfrom scipy import stats import numpy as np mean, s, n = 50, 10, 25 se = s / np.sqrt(n) lo, hi = stats.t.interval(0.95, df=n - 1, loc=mean, scale=se) # 45.87, 54.134 Run a z-test: sample mean 52, hypothesised mean 50, sigma 10, n = 100. What is the two-sided p-value?
mediumz = (52 - 50) / (10 / 10) = 2. The two-sided p-value is 2 x P(Z > 2) = 2 x 0.02275 = 0.0455. At a 5 percent level you reject the null, but only just. The effect, a difference of 2 on a standard deviation of 10, is small (Cohen's d of 0.2), so statistical significance here is driven by the sample size. Report the interval, 52 plus or minus 1.96 x 1, which is 50.04 to 53.96.
5 Explain Type I error, Type II error and power.
easyA Type I error is rejecting a true null hypothesis; its probability is alpha, usually 0.05. A Type II error is failing to reject a false null; its probability is beta. Power is 1 - beta, the chance of detecting a real effect. Power rises with larger effects, larger samples and a larger alpha, and falls with noisier data. Lowering alpha to reduce false positives increases beta unless you collect more data. Aim for 80 percent power or more when you plan a study.
6 How many observations per group do you need to detect a difference of 2 when sigma is 10, at alpha 0.05 and 80 percent power?
hardFor a two-sided two-sample comparison of means, n per group = 2 sigma^2 (z_alpha/2 + z_beta)^2 / delta^2. With z_alpha/2 = 1.96 and z_beta = 0.84, the sum is 2.8 and its square is 7.84. So n = 2 x 100 x 7.84 / 4 = 392 per group. Halving the detectable difference to 1 quadruples the requirement to 1,568. That squared relationship is why detecting tiny effects is expensive.
7 When do you use a t-test, a Welch t-test and a paired t-test?
mediumA one-sample t-test compares a mean with a fixed value. A two-sample t-test compares two independent groups; Welch's version does not assume equal variances and is the safer default. A paired t-test is for the same units measured twice, such as before and after, and works on the differences, which removes between-subject variation and gives more power. For strongly skewed small samples use a Mann-Whitney U test or a permutation test.
pythonfrom scipy import stats stats.ttest_ind(a, b, equal_var=False) # Welch stats.ttest_rel(before, after) # paired stats.mannwhitneyu(a, b) # non-parametric8 Run a chi-square test on a 2 x 2 table of observed counts [[30, 20], [20, 30]].
mediumRow and column totals are all 50 and the grand total is 100, so each expected count is 50 x 50 / 100 = 25. Chi-square = 4 x (5^2 / 25) = 4.0 with (2 - 1)(2 - 1) = 1 degree of freedom, giving p = 0.0455, the same as a z-test with z = 2, because chi-square with one degree of freedom is z squared. Expected counts should be at least 5 or so; otherwise use Fisher's exact test. The test shows association, not its strength: add Cramer's V or the odds ratio.
pythonfrom scipy.stats import chi2_contingency chi2, p, dof, expected = chi2_contingency([[30, 20], [20, 30]], correction=False) print(chi2, p, dof) # 4.0 0.0455 19 Compute the z-score and approximate percentile of an exam score of 85 when the mean is 70 and the standard deviation is 10.
easyz = (85 - 70) / 10 = 1.5. The standard normal cumulative probability at 1.5 is 0.9332, so the score is at about the 93rd percentile, assuming a roughly normal distribution. The empirical rule gives 68 percent within one standard deviation, 95 percent within two and 99.7 percent within three. z-scores let you compare values on different scales, such as a 85 in one test and a 60 in another with different means and spreads.
10 Compute the Pearson correlation for x = 1 to 5 and y = 2, 4, 5, 4, 5, and say how it differs from Spearman.
mediumMeans are 3 and 4. Deviations of x are -2, -1, 0, 1, 2 and of y are -2, 0, 1, 0, 1. Sum of products = 6, sum of squared x deviations = 10, sum of squared y deviations = 6, so r = 6 / sqrt(60) = 0.775. Pearson measures linear association and is sensitive to outliers. Spearman is Pearson on the ranks, so it captures any monotonic relationship and is robust to outliers. Correlation says nothing about causation and can be zero for a clear nonlinear pattern.
11 What is the multiple comparisons problem?
mediumIf you run 20 independent tests at alpha = 0.05 with no real effects, the chance of at least one false positive is 1 - 0.95^20 = 0.64. Control it with Bonferroni, which tests each hypothesis at alpha / m (0.0025 for 20 tests) and is simple but conservative, or with Benjamini-Hochberg, which controls the false discovery rate and is better when you screen many features. Pre-register the main hypothesis, and report how many comparisons you made.
12 Interpret R squared and adjusted R squared. SSres = 20, SStot = 100, n = 30, p = 3 predictors.
mediumR squared = 1 - 20 / 100 = 0.80, meaning the model explains 80 percent of the variance in the sample. Adding any predictor never lowers R squared, so adjust: 1 - (1 - 0.8)(n - 1) / (n - p - 1) = 1 - 0.2 x 29 / 26 = 0.777. A high R squared does not prove the model is correct, and a low one can still be useful when the outcome is noisy. Check residual plots for patterns, and use out-of-sample error for predictive work.
13 How does bootstrapping work, and when is it useful?
mediumResample the observed data with replacement many times, each sample the same size as the original, compute the statistic on each, and use the distribution of results to estimate standard errors and percentile confidence intervals. It needs no distribution assumptions, and works for medians, ratios and other awkward statistics. It does not fix a biased or too-small sample and behaves badly for extreme statistics such as the maximum.
pythonimport numpy as np rng = np.random.default_rng(0) boot = [np.median(rng.choice(data, size=len(data), replace=True)) for _ in range(5000)] ci = np.percentile(boot, [2.5, 97.5])
Frequently asked questions
Which statistics topics matter most for data science interviews?
Descriptive statistics, the normal distribution, confidence intervals, hypothesis tests, p-values, correlation, regression assumptions and A/B testing.
Do I need to memorise z and t tables?
No, but remember the common values: 1.645, 1.96 and 2.576 for 90, 95 and 99 percent two-sided intervals, with 1.64, 1.96 and 2.58 as rounded forms.
How do I explain a p-value to a non-technical person?
Say it is how surprising the data would be if there were really no effect. A small value means the data would be unusual under no effect, not that the effect is large or important.
How is this page different from the probability page?
This page covers inference from data, and the probability page covers counting, conditional probability and distributions used in puzzles.
Related guides
More in Role-wise Interview Questions by Job and Tech Stack
- Tableau Interview Questions and Answers
- Terraform Interview Questions and Answers
- Web Performance Interview Questions and Answers
- Web Security and OWASP Interview Questions and Answers
- A/B Testing Interview Questions and Answers
- Android Developer Interview Questions and Answers
- Angular Interview Questions and Answers (Angular 18 and Later)
- Ansible Interview Questions and Answers
- API Testing and Postman Interview Questions
- Automation Testing Interview Questions and Answers
- AWS Interview Questions and Answers
- Azure Interview Questions and Answers