Skip to content

Statistics interview questions

Inference, uncertainty and the ideas that people most often get subtly wrong in interviews.

56 questions in this category.

These cards cluster around inference and error: p-values, confidence intervals, power and the two ways a test can be wrong; the distributions and limit theorems behind them; correlation and what fakes it, from confounders to selection bias and Simpson's paradox; regression diagnostics from residuals to heteroscedasticity and multicollinearity; and the measures that compare two distributions, from KL divergence to the Kolmogorov-Smirnov test.

Start with these

  1. What is a p-value?
  2. What is a confidence interval?
  3. What is a Type I and a Type II error?
  4. The normal distribution derives its importance from which famous theorem?
  5. Why doesn't correlation imply causation?
What is the difference between "long" and "wide" format data?
Wide: categorical data is grouped in a single row, long: each row is an observation belonging to a particular category.
What is a Type I and a Type II error?
Type I errors are false positives (rejecting a true null hypothesis) and Type II errors are false negatives (missing a real effect).
What two parameters define a normal distribution?
Its mean and its standard deviation.
What is the difference between a nominal and an ordinal feature?
Nominal data names categories with no natural order, ex: eye color, city or payment method. Ordinal data has categories with a meaningful order but no fixed spacing between them, ex: grades A, B, C, D, E and F.
What does high and low cardinality mean?
High cardinality refers to columns with values that are very uncommon or unique, example: email addresses, or user names. And low cardinality: refers to columns with few unique values, example: status flags, boolean values.
What is R-squared?
R-squared, the coefficient of determination, is the proportion of variance in the target that the model explains: R² = 1 − SS_res / SS_tot. 1 is a perfect fit, 0 is no better than predicting the mean, and on new data it can even be negative.
What is a residual?
It is the difference between the observed value and the value estimated by the model: eᵢ = yᵢ − ŷᵢ.
What is dimensionality reduction?
It is the process of reducing the number of variables under consideration by obtaining a set of principal variables.
What is a false negative?
An example in which the model mistakenly predicted the negative class.
What is a false positive?
An example in which the model mistakenly predicted the positive class.
Precision is the ratio between which two quantities?
True positives over predicted positives, TP / (TP + FP): of the cases you flagged, how many were right. It says nothing about the positives you missed, so it is read alongside recall, and it is the metric to favour when a false alarm is the costly error.
What does stationarity in a dataset mean?
A property of data in a dataset, in which the data distribution stays constant across one or more dimensions. Most commonly, that dimension is time.
The normal distribution derives its importance from which famous theorem?
The Central Limit Theorem: the mean of n independent draws from a distribution with finite variance is approximately normal for large n, whatever the population's shape. That is what justifies normal-based confidence intervals and t-tests on non-normal data, provided the sample is large enough for the data's skew.
Name three techniques of dimensionality reduction.
Singular Value Decomposition (SVD), Principal Component Analysis (PCA), Linear Discriminant Analysis (LDA), Autoencoders, Fourier and Wavelet Transforms.
Measures how far a set of (random) numbers is spread out from their average value.
Variance: the average squared deviation from the mean. Its square root, the standard deviation, measures the same spread in the original units.
What values could you infer from a boxplot?
The median (the line inside the box, not the mean), the first and third quartiles (the box edges, whose gap is the IQR), the whisker ends and any outliers. Whiskers stop at the most extreme point within 1.5 × IQR of the box, so they show the minimum and maximum only when no outliers are drawn.
Is rotation necessary in PCA?
Not as an extra step: PCA is itself an orthogonal rotation of the axes onto the directions of maximum variance. A further rotation such as varimax is optional and only aids interpretation; it keeps the total explained variance but loses the variance-maximizing order.
What is the difference between covariance and correlation?
Correlation is covariance divided by the two standard deviations, so it is unitless and bounded in [-1, 1], while covariance carries the units of both variables and has no fixed scale. That is what makes correlation comparable across pairs; both only capture linear association.
Is it possible to capture the correlation between a continuous and a categorical variable?
Yes. Use the point-biserial correlation when the category has two levels, or one-way ANOVA with eta squared (the correlation ratio) for more levels; Kruskal-Wallis if the data are skewed. ANCOVA answers a different question: it compares group means while adjusting for a continuous covariate.
If pearson correlation is 0 between two variables can we assume that there isn't any relation between them?
No. Pearson correlation coefficient between 2 variables might be zero even when they have a relationship between them. Example: x and x^2
Give 3 techniques for handling missing values.
Delete rows (or columns) with missing data; impute with a simple statistic such as the mean, median or mode; or predict the missing values from the other features with a model such as k-NN or regression imputation.
What is the Law of Large Numbers?
A theorem stating that as the number of independent trials increases, the average of the results gets closer to the expected value.
What is Survivorship bias?
Is the logical error of concentrating on the people or things that made it past some selection process and overlooking those that did not.
What is a confounding variable?
A variable that influences both the independent and the dependent variable, distorting the association between them: it can create a spurious link, hide a real effect or even reverse it.
What is autocorrelation?
It is the correlation of a signal with a delayed copy of itself, as a function of the delay (lag).
What is MSE?
MSE stands for Mean Squared Error. And is a measure of how close a fitted line is to data points by measuring the average squared of the errors.
What is RMSE?
Root Mean Squared Error: the square root of MSE, which puts the error back in the units of the target. Squaring first lets large misses dominate, so RMSE is always at least MAE and far more outlier-sensitive — report MAE too when a handful of extreme rows drives the number.
How can we select K for K-means?
Domain knowledge first, then the elbow of inertia against k, average silhouette, or the gap statistic. Inertia falls monotonically, so the elbow is often ambiguous; silhouette scores separation as well as compactness. If a downstream use defines the segments, let that pick k.
What is precision and recall at k?
Precision at k and recall at k are evaluation metrics for ranking algorithms.
What is KL divergence?
The Kullback-Leibler divergence, KL(P ‖ Q) = Σ P(x) log(P(x) / Q(x)), measures how much information is lost when Q is used to approximate P. It is never negative, is zero only when P = Q, and is not symmetric, so it is not a distance.
What is the Jensen-Shannon divergence?
A symmetric, bounded measure of the difference between two distributions: the average KL divergence of each from their mixture M = (P + Q) / 2. It is 0 for identical distributions, at most ln 2 (1 bit), and stays finite even when the distributions don't overlap.
What is the Kolmogorov-Smirnov test?
A nonparametric test of whether a sample follows a given distribution, or whether two samples come from the same one. Its statistic D is the largest vertical gap between the two cumulative distribution functions.
What is a p-value?
The probability, if the null hypothesis were true, of getting a result at least as extreme as the one observed. A small p-value means the data would be surprising if there were no effect; it is not the probability that the null hypothesis is true.
What is a confidence interval?
A range computed from a sample by a method that, over repeated samples, captures the true parameter a stated share of the time, such as 95%. The 95% describes the method, not the chance that this particular interval contains the true value.
What is heteroscedasticity?
When the spread of a regression's errors changes across the range of the inputs instead of staying constant, which is called homoscedasticity. The coefficient estimates stay unbiased, but the usual standard errors, and so the p-values and confidence intervals, become unreliable.
What is the Poisson distribution?
The distribution of the number of events in a fixed interval when events happen independently at a constant average rate λ: P(k) = λᵏ e^(−λ) / k!. Its mean and its variance are both λ.
What is the binomial distribution?
The distribution of the number of successes in n independent trials that each succeed with the same probability p: P(k) = C(n, k) pᵏ (1 − p)ⁿ⁻ᵏ. Its mean is np and its variance np(1 − p).
Why doesn't correlation imply causation?
Because an association can come from a confounder that drives both variables, from causation running the other way, from how the data were selected, or from chance. Only an experiment, or careful causal analysis of observational data, shows that changing one changes the other.
What is Simpson's paradox?
A trend that shows up in every subgroup of the data reverses, or disappears, when the groups are combined. It happens when a third variable is unevenly spread across the groups, so the right answer depends on the causal story, not the arithmetic.
What do skewness and kurtosis measure?
Skewness measures a distribution's asymmetry: positive when the right tail is longer, negative when the left one is. Kurtosis measures how heavy the tails are compared with a normal distribution, which has kurtosis 3, or excess kurtosis 0.
What is selection bias?
Distortion that occurs when the data you analyze are not representative of the population you want to draw conclusions about, because of how units ended up in the sample. Survivorship bias, non-response bias and self-selection are common forms.
What is a probability density function?
A function that describes a continuous random variable: the probability of landing in an interval is the area under the curve over that interval. Its value at a point is a density, not a probability, so it can exceed 1. The cumulative distribution function (CDF) gives P(X ≤ x).
What is maximum likelihood estimation?
A way to fit a model's parameters by choosing the values that make the observed data most probable: maximize the likelihood L(θ) = Π p(xᵢ | θ), in practice its logarithm. Least squares and logistic regression's log loss are both maximum likelihood under particular assumptions.
What is statistical power?
The probability that a test rejects the null hypothesis when a real effect of a given size exists, 1 − β. It grows with sample size, effect size and the significance level; 80% is the usual target when planning an experiment.
What is a t-test?
A test of whether a mean differs from a given value, or whether two means differ, when the population standard deviation is unknown and estimated from the sample. The statistic is the difference divided by its standard error, which follows a t distribution under the null hypothesis.
What is the Bonferroni correction?
A fix for multiple comparisons: when you run m tests, compare each p-value with α/m instead of α. It keeps the probability of any false positive, the family-wise error rate, at or below α, at the cost of power.
What is multicollinearity?
When two or more predictors in a regression are strongly correlated, so the model can't separate their individual effects. Their coefficients get large standard errors and can swing or flip sign between samples, though the predictions are often fine.
What is the difference between Bayesian and frequentist statistics?
Frequentists treat parameters as fixed and probability as a long-run frequency, so they reason about how the data would vary over repeated samples. Bayesians treat parameters as uncertain, start from a prior distribution and update it with the data into a posterior.
What is adjusted R-squared?
R-squared corrected for the number of predictors: 1 − (1 − R²)(n − 1)/(n − p − 1), with n rows and p predictors. Unlike R², it only rises when a new predictor improves the fit by more than chance would, so it can fall when you add a useless one.

Created by santiviquez

About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.