P
prepair.app
Start interview →
EnglishУкраїнськаРусскийDeutsch
📊

Data scientist interview questions

Data science interviews test three things at once: whether you actually understand statistics rather than reciting definitions, whether you can pull and shape data yourself with SQL and pandas, and whether you can turn a model into a decision someone will act on. Below are the questions asked most often, each with a model answer.

Junior · no experience / under 1 yearMiddle · 2–4 years of experienceSenior · 5+ years of experience

What they ask about

Statistics and probability fundamentals
Hypothesis testing, p-values, confidence intervals
SQL and data manipulation with pandas
Regression, classification, feature engineering
A/B testing and experiment design
Causal inference and communicating results

9 real questions with answers

Every question comes with a model answer you can compare yours against.

1

When would you report the median instead of the mean?

Answer

When the distribution is skewed or has outliers a mean can't survive — income, latency, time-to-purchase. One executive salary or one 30-second outlier request drags the mean somewhere no typical data point actually sits, while the median stays where the bulk of the data is. In practice you report both plus a percentile like p95, because the gap between mean and median is itself informative about skew.

2

What does a p-value actually mean, and what is the most common misreading of it?

Answer

A p-value is the probability of seeing data this extreme (or more) if the null hypothesis were true — it is not the probability the null hypothesis is true, and it is not the probability your result is due to chance. The common misreading treats p < 0.05 as "95% confident the effect is real," which conflates a statement about the data given the hypothesis with a statement about the hypothesis given the data. That confusion is exactly what drives p-hacking: run enough tests and one crosses 0.05 by chance alone.

3

What does a 95% confidence interval actually tell you?

Answer

If you repeated the sampling process many times and built an interval the same way each time, 95% of those intervals would contain the true parameter — it is a statement about the procedure, not a 95% probability that this particular interval contains the true value. A wide interval is honest information: it usually means the sample is too small to say much, and a point estimate without it is a number pretending to be more certain than the data support.

4

When do you reach for a window function instead of GROUP BY in SQL?

Answer

GROUP BY collapses rows into one per group, so you lose the row-level detail. A window function like ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY created_at) computes a value across a partition but keeps every row — that's what you need for "latest order per customer," running totals, or rank-within-group. Reaching for a self-join or a subquery where a window function would do is the classic sign of someone who learned SQL before window functions were common.

5

How do you decide between a regression and a classification approach for the same business question?

Answer

It comes down to what the target actually is and how the output will be used, not which model performs better in isolation. "Will this user churn in 30 days" is naturally a classification with a threshold you tune to a business cost of false positives vs false negatives; "how much revenue will this account generate" is a regression, and turning it into buckets throws away information the business usually wants. Sometimes the honest answer is to model the continuous target and derive the classification downstream, which keeps you from baking an arbitrary threshold into the model itself.

6

Explain the bias-variance trade-off with a concrete example.

Answer

A high-bias model — say a linear regression on data with real curvature — underfits: it is consistently wrong in the same direction on train and test alike. A high-variance model — a deep, unpruned decision tree — overfits: it memorizes training noise and its performance swings wildly between training and test data. Regularization, cross-validation, and simpler feature sets all trade some bias for a real reduction in variance, and the goal is the sweet spot where test error, not train error, is minimized.

7

How do you determine sample size before running an A/B test?

Answer

You need four inputs: baseline conversion rate, the minimum detectable effect worth caring about, statistical power (usually 80%), and significance level (usually 0.05). Smaller effects and higher power both demand more traffic, which is why teams that skip this step end up either running underpowered tests that can't detect a real effect, or running months-long tests for a change too small to matter. A power calculation before launch is what turns "the test showed no difference" into a real answer instead of a shrug.

8

What are the most common ways an A/B test gives you a wrong answer even when the statistics are done correctly?

Answer

Peeking at results and stopping early the moment they look significant inflates the false-positive rate far above 5%, because you're really running many implicit tests across time. Sample ratio mismatch — the actual split deviating from the intended 50/50 — usually signals a bug in the assignment logic and invalidates the result before you even look at the metric. Novelty effects inflate short-term lifts that fade, and network effects between test and control groups (two users in the same social graph, one in each arm) violate the independence the test statistics assume.

9

Why does correlation not imply causation, and what tools do you reach for when you can't run an experiment?

Answer

Two variables can move together because one causes the other, because a third variable causes both (a confounder), or by pure coincidence in a big enough dataset. When randomization isn't possible, you reach for quasi-experimental designs: difference-in-differences, regression discontinuity around a threshold, instrumental variables, or propensity score matching to approximate a randomized comparison from observational data. Each of these leans on an assumption you can't fully verify, so the honest deliverable is the estimate plus a clear statement of what would break it.

🦎

Reading answers is not enough

In a real interview you speak under pressure. Cam asks these same questions, scores every answer, and shows exactly what to fix.

Practice a Data Scientist interview →
Free · 3 interviews per month

Worth reading

All articles →

Other specializations

🔍Manual QA🤖QA AutomationJava Backend🐍Python Backend🐘PHP Backend🦫Go Backend🟢Node.js Backend💎Ruby on Rails🟣.NET Backend Developer🔷C++🟨JavaScript⚛️React Frontend💚Vue Frontend🅰️Angular FrontendNext.js🍏iOS (Swift)🟩Android (Kotlin)📱React Native Developer⚙️DevOps / SRE🗄️Data Engineer🧠AI/ML Engineer📈Business Analyst🎯Product Manager📋Project Manager🎨UI/UX Designer📣Marketing🧑‍💼HR / Recruiter🤝Sales / Account Manager🎧Technical Support Engineer