Interviews & offers
Data Science Interview Questions: SQL, Stats, ML and Product Cases
By the AIJobDesk team · Updated
Data science interviews usually test SQL, statistics and probability, A/B testing, machine learning and product sense, plus Python coding and behavioral questions. To answer well, state your assumptions, show your reasoning step by step and tie the technical answer back to a business decision.
Data science interview questions usually fall into five buckets: SQL, statistics and probability, A/B testing, machine learning and product sense, plus Python coding and behavioral rounds. The best answers state assumptions, reason step by step and connect the result to a business decision. Below are real-style questions in each bucket and what interviewers want to see.
What does a data science interview loop look like?
Loops differ by company and by the flavor of the role:
| Role flavor | Heaviest rounds |
|---|---|
| Product or analytics data scientist | SQL, A/B testing, product sense |
| ML-focused data scientist | ML theory, Python modeling, ML case |
| Research or causal inference | Statistics, experiment design, methods deep dive |
Most loops also include a recruiter screen, a technical screen (often SQL), sometimes a take-home, and a behavioral round. Ask the recruiter which flavor the role is. It changes what you should practice.
SQL interview questions
SQL is the most consistently tested skill for data scientists. Expect a shared editor and realistic tables like users, orders and events.
1. Find the second-highest order value per customer.
Tests window functions. A good answer uses DENSE_RANK() or ROW_NUMBER() partitioned by customer and explains how ties are handled.
2. Compute 7-day rolling active users. Tests date logic and windows. Strong candidates clarify the definition of "active" and handle days with zero events.
3. Find users who made a purchase within 7 days of signing up.
Tests joins and date arithmetic. Mention that a LEFT JOIN versus INNER JOIN changes which users appear.
4. Calculate month-over-month revenue growth.
Tests LAG() and aggregation. Watch for division by zero in the first month.
5. Find duplicate rows and keep only the latest.
Tests deduplication with ROW_NUMBER() ordered by timestamp.
What interviewers look for: correct joins, awareness of NULLs and duplicates, clear CTEs instead of nested subqueries, and checking the output makes sense.
Statistics and probability questions
6. Explain a p-value to a non-technical stakeholder. "If there were truly no difference, a p-value of 0.03 means we'd see a result this extreme about 3% of the time by chance." Then the key caveat: it isn't the probability the hypothesis is true.
7. What's a confidence interval? A range built so that, over many repeated samples, 95% of such intervals would contain the true value. Strong answers link the width to sample size and variance.
8. When would you use the median instead of the mean? Skewed data or outliers, such as revenue per user or session length.
9. You flip a coin 10 times and get 8 heads. Is it biased? Compute or estimate the probability of 8 or more heads under a fair coin (about 5.5%), discuss one- versus two-sided tests and note that 10 flips is a small sample.
10. Explain Bayes' theorem with an example. Classic medical test example: a 99% accurate test for a rare disease still yields mostly false positives when prevalence is low. Walk through the numbers.
A/B testing and experimentation questions
11. How would you design an A/B test for a new checkout button? Define the primary metric (conversion rate), guardrails (revenue per user, page load time), randomization unit (user, not session), sample size from baseline rate, minimum detectable effect, significance level and power, and test duration covering full weekly cycles.
12. The test shows a significant lift on day 3. Do you stop? No. Peeking inflates false positives. Run to the planned sample size, or use a sequential testing method designed for early looks.
13. What is a novelty effect? Users react to anything new at first. Look at results over time or by new versus returning users.
14. The treatment improved the primary metric but hurt a guardrail. What do you recommend? Quantify both in business terms, check segments, and propose options: ship with changes, ship to a segment or iterate. Interviewers want a clear recommendation, not "it depends."
15. When can't you run an A/B test? Network effects, legal constraints or one-off changes like a pricing announcement. Alternatives: switchback tests, geo experiments, difference-in-differences or synthetic control.
Machine learning questions
16. How would you build a churn prediction model? Define churn precisely, pick a prediction window, build features from usage history without leakage, start with logistic regression or gradient boosting, evaluate with precision and recall at a useful threshold and explain how the business will act on the scores.
17. Precision or recall for a fraud model? Depends on costs: missed fraud versus blocking real customers. Say how you'd pick a threshold with the business.
18. How do you explain a model to stakeholders? Feature importance, SHAP values for individual predictions and simple examples. Avoid overclaiming causation from feature importance.
Our machine learning interview questions guide goes deeper on ML theory.
Product sense and case questions
19. Daily active users dropped 10% yesterday. How do you investigate? A structured answer: confirm the data is right (logging or pipeline issue?), check if it's external (holiday, outage), segment by platform, region, app version and user type, then form and test hypotheses. Interviewers grade structure above all.
20. How would you measure the success of a new "save for later" feature? Define the goal (more purchases eventually, not just saves), pick a primary metric, supporting metrics (save rate, return visits) and guardrails (direct purchase rate shouldn't fall), and describe the experiment.
21. Should we launch a feature that increases engagement but decreases revenue short term? Discuss long-term value, how to estimate it, and what data you'd need. Give a recommendation.
Sample answer: the metric-drop question
Here's what a strong answer to question 19 sounds like, condensed:
"First I'd check whether the drop is real. Did a logging change ship yesterday, did a pipeline job fail, is the dashboard's definition of active the same as last week? I'd compare the number against a second source such as server logs.
If it's real, I'd check external causes: a holiday, a competitor launch, an outage or an app store issue.
Then I'd segment. Is the drop concentrated in one platform, app version, country or acquisition channel? A drop only on Android users on the newest version points to a bug in that release. A drop only among new users points to acquisition or onboarding.
Next I'd look at the funnel: are fewer people opening the app, or are they opening it and failing to reach the action that counts as active?
Once I find the segment, I'd form a hypothesis, check it with the release log or the team that owns that area, and estimate the impact so we can decide whether to roll back."
Notice the order: data quality, external factors, segmentation, funnel, hypothesis, action. That structure is what interviewers grade, and it works for almost any "metric moved" question.
Questions to ask your interviewers
The end of each round is a chance to learn whether the team is a good fit:
- How do data scientists here split time between analysis, experimentation and modeling?
- Who decides which experiments run, and how are results reviewed?
- What does the data stack look like, and how reliable is it?
- What's a recent analysis that changed a product decision?
Teams with clear answers usually have mature data practices. Vague answers can signal that you'd spend most of your time building pipelines or fixing dashboards.
Python and pandas questions
- Group transactions by user and compute each user's average order value.
- Merge two DataFrames and find rows in one but not the other.
- Write a function that bootstraps a confidence interval for a median.
- Clean a column of messy date strings and count events per week.
How to answer: a simple framework
- Clarify the goal and definitions.
- State assumptions out loud.
- Solve step by step, narrating as you go.
- Sanity-check the result.
- Recommend an action.
Mistakes to avoid
- Jumping into SQL without clarifying table grain.
- Reciting formulas without interpreting them.
- Ending a case question without a recommendation.
- Ignoring data quality as a possible cause.
- Not preparing project stories; see our guide to behavioral interviews at AI companies.
A three-week prep plan
- Week 1: SQL daily (two or three problems), plus statistics review.
- Week 2: A/B testing and product cases. Practice five metric-drop investigations out loud.
- Week 3: ML review, a practice take-home assignment and two mock interviews.
Next step
If you're still building toward the role, read how to become a data scientist or the guide on moving from data analyst to data scientist. When you're ready to apply, browse data scientist jobs. Right now we list 10 open roles, with a median advertised range of $347K–$445K in US listings that publish pay.
Ready to apply? Browse Data Scientist jobs
Frequently asked questions
- What are the most common data science interview questions?
- Expect SQL questions with joins, window functions and aggregations; statistics questions on p-values, confidence intervals and distributions; A/B testing questions on sample size and interpreting results; ML questions on overfitting, metrics and model choice; and product questions such as how you'd measure the success of a feature or investigate a drop in a key metric.
- How do you answer data science interview questions?
- Clarify the question and the goal, state assumptions out loud, work through the solution step by step and end with what the result means for a decision. For product and case questions, structure your answer before diving in. Interviewers grade your reasoning as much as the final answer, so narrate your thinking.
- What's the difference between data science and data analytics interview questions?
- Data analyst interviews focus heavily on SQL, dashboards, metrics and business questions, with lighter statistics. Data science interviews add deeper statistics, experiment design, machine learning and often Python coding. Product data scientist roles sit in between and weigh product sense and A/B testing most heavily.
- How much Python is tested in data science interviews?
- Usually enough to manipulate data and implement simple logic: pandas operations like groupby, merge and pivot; writing a function to compute a metric; and sometimes basic algorithm questions. ML-heavy roles may ask you to train and evaluate a model in scikit-learn or implement a simple algorithm from scratch.
- How should freshers prepare for data science interviews?
- Get very comfortable with SQL first, since it's the most consistently tested skill. Then review core statistics and A/B testing, practice explaining two projects end to end, and do mock product case questions. A portfolio project that answers a real business question with clean analysis helps more than a complex model.
- Are take-home assignments common for data science roles?
- Yes, more than for many engineering roles. A typical take-home gives you a dataset and a business question and asks for an analysis or model with a short written summary. Graders care about clear framing, sound methods, honest caveats and a crisp recommendation more than fancy techniques.