The interview problem
Explain a t interval for a small sample and the assumptions that make it exact.
Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.
1. Scope and worked approach
Assume independent identically distributed normal observations with unknown variance. Estimate the standard error as sample standard deviation divided by square root of n; use n−1 degrees of freedom for the t quantile. This interval concerns the population mean, not a future observation. Inspect dependence and outliers before applying the formula; normality is especially consequential for tiny samples.
2. Trace the design or derivation
Define independent units → estimate mean and spread → choose t quantile → form mean interval
For normally distributed future observations, the corresponding prediction standard error includes a factor sqrt(1+1/n), rather than only 1/sqrt(n). The extra term represents irreducible variation of the new observation. This explains why collecting more data can shrink uncertainty about a mean without eliminating individual variability.
3. Calculate the example
For n=9, sample mean 20 and sample standard deviation 6, standard error is 2. Using a supplied two-sided 95% t critical value of approximately 2.306 gives 20±4.612, or [15.388,24.612]. A prediction interval for one new value would be wider.
4. Failure cases and trade-offs
Repeated measurements from the same device are not nine independent units. Heavy tails can make mean and variance estimates unstable. A normal z critical value understates uncertainty in this small-sample setting; robust alternatives change assumptions and sometimes the target quantity.
5. Validation, follow-ups and self-review
Recompute after duplicating every row: apparent sample size doubles but independent information does not. Follow-up: what changes for paired measurements? Self-review: name the estimand, sampling unit and variance assumption.
Sources and related practice
Technical reference: docs.scipy.org — Student's t distribution and quantiles.
Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.
Continue with Interpret uncertainty and confidence intervals in model evaluation; Choose a bootstrap strategy for dependent observations.
Continue your preparation
Choose a connected learning path or browse more ML fundamentals questions. Read our editorial method and attribution policy.