Data Science Interview Questions and Preparation Guide
Prepare for complex statistical, machine learning, and analytical interview questions with an AI Data Scientist coach.
Data science interviews test a wide range of skills: SQL, statistics, programming, machine learning, and the business judgement to turn analysis into decisions. The exact mix depends on the role — a product data analyst will face more SQL and metrics questions, while a machine learning–focused data scientist will face more modelling and coding.
This guide covers the typical interview rounds, the topics to revise, sample questions with model answers, and a practical study plan for data scientist and data analyst roles.
Typical data science interview rounds
- Recruiter screen: background, motivation and role fit.
- SQL and coding: writing queries and Python (pandas) code on realistic datasets.
- Statistics and probability: hypothesis testing, distributions, A/B testing.
- Machine learning: model choice, evaluation, overfitting, feature engineering.
- Product or business case: defining metrics, diagnosing a metric drop, sizing an opportunity.
- Take-home or presentation: an analysis you complete and present.
- Behavioral: collaboration with stakeholders and communicating results.
SQL interview questions
Find the second-highest salary in an employees table.
One approach: SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees). A more general approach uses DENSE_RANK() OVER (ORDER BY salary DESC) and filters for rank 2, which also handles the Nth-highest case and ties.
What is the difference between WHERE and HAVING?
WHERE filters rows before aggregation; HAVING filters groups after aggregation, so it can reference aggregate functions like COUNT or SUM.
Calculate 7-day rolling average revenue per day.
Aggregate revenue by date, then use a window function: AVG(daily_revenue) OVER (ORDER BY date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW). Mention how you would handle missing dates.
When would you use a LEFT JOIN instead of an INNER JOIN?
Use a LEFT JOIN when you need every row from the left table even if there is no match — for example, all users including those with zero orders.
Statistics and A/B testing questions
Explain a p-value to a non-technical stakeholder.
If there were truly no difference between the two versions, the p-value is the probability of seeing a result at least as extreme as the one we observed. A small p-value suggests the result is unlikely to be due to chance alone — it does not tell us how large or important the effect is.
How would you design an A/B test for a new checkout button?
Define a primary metric (checkout conversion) and guardrail metrics (revenue per user, errors), estimate the sample size from the baseline rate and minimum detectable effect, randomise at the user level, run for full weekly cycles, and avoid stopping early just because results look significant.
What is the difference between Type I and Type II errors?
A Type I error is a false positive — concluding there is an effect when there isn’t. A Type II error is a false negative — missing a real effect. Significance level controls the first; statistical power relates to the second.
Machine learning interview questions
What is overfitting and how do you prevent it?
Overfitting is when a model learns noise in the training data and performs poorly on new data. Prevent it with more data, cross-validation, regularisation (L1/L2), simpler models, early stopping and feature selection.
Explain the bias–variance trade-off.
Bias is error from overly simple assumptions; variance is error from sensitivity to the training data. Increasing model complexity usually lowers bias and raises variance — the goal is the balance that minimises error on unseen data.
Precision vs. recall — which matters more?
It depends on the cost of errors. For fraud detection or medical screening, missing a positive is costly, so recall matters more. For spam filtering, wrongly flagging legitimate email is costly, so precision matters more. The F1 score balances both.
How would you handle an imbalanced dataset?
Use appropriate metrics (precision, recall, PR-AUC rather than accuracy), resampling or class weights, threshold tuning, and collect more minority-class data where possible.
Product and business case questions
A common prompt: “Daily active users dropped 10% last week. How would you investigate?” A strong answer is structured: confirm the data is correct (tracking or pipeline issues), check whether the drop is seasonal, segment by platform, region, app version and acquisition channel, look for related product changes or outages, and then form and test hypotheses. Finish by explaining how you would communicate findings and what action you would recommend.
A 6-week data science interview study plan
- Week 1: SQL — joins, aggregation, window functions, CTEs.
- Week 2: Python and pandas — cleaning, grouping, merging, basic visualisation.
- Week 3: Statistics — distributions, hypothesis testing, confidence intervals, A/B testing.
- Week 4: Machine learning — regression, classification, trees and ensembles, evaluation metrics.
- Week 5: Product metrics and case questions.
- Week 6: Mock interviews, project walkthroughs and behavioral stories.
Practise explaining your analysis
Many data science candidates know the material but struggle to explain it simply. InterviPrep’s AI interviewer asks SQL, statistics, ML and case questions by voice and gives feedback on accuracy and clarity, so you can practise communicating like a data scientist stakeholders trust.
Frequently asked questions
What is the difference between data analyst and data scientist interviews?
Data analyst interviews focus more on SQL, dashboards, metrics and business questions. Data scientist interviews add statistics depth, machine learning and often more programming.
Do I need deep learning for data science interviews?
Only for roles that explicitly mention it. Most data science interviews focus on SQL, statistics, classical machine learning and business cases.
How important is SQL for data science interviews?
Very important. SQL appears in most data science and analytics interview loops, often as the first technical screen.
Start your preparation journey
Join thousands of professionals using AI to master their interviews and land their dream jobs.
Start Free Trial