9 role-specific questions
Data Scientist Interview Questions & Answers
Data science interviews cover machine learning fundamentals, choosing and evaluating models, feature engineering, statistics, and getting models into production responsibly.
Free, no sign-up. 82 questions in this role's practice pool, including behavioural, HR and situational questions.
Data science & machine learning interview questions
Modelling, evaluation, overfitting, features, experimentation and ML in production.
1.
What is overfitting, and how do you prevent it?
BeginnerTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Core ML understanding.
Key points a strong answer covers
- Definition. The model learns noise in the training data and fails to generalise.
- Detect. A gap between training and validation performance; cross-validation.
- Regularisation. Regularisation (L1/L2, dropout).
- Simpler model / more data. Simpler models, feature selection, more data, early stopping.
- Bias–variance. It's the variance side of the bias–variance trade-off.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Tuning on the test set.
- Not mentioning validation.
Likely follow-up questions
- How does cross-validation help?
- What's data leakage, and how does it look like overfitting's opposite?
Example strong answer
Overfitting is when a model learns the training data too closely — including its noise — so it performs very well on training data but poorly on new data. I detect it by comparing training and validation performance, ideally with cross-validation; a big gap is the warning sign. To prevent it: start with a simpler model, select fewer, better features, add regularisation like L1 or L2 or dropout in neural networks, use early stopping, limit depth in tree models, and get more or augmented data. It's the high-variance side of the bias–variance trade-off; underfitting is the opposite. And the test set stays untouched until the very end, so I'm not overfitting to it through tuning.
2.
How do you choose an evaluation metric for a classification model? Discuss imbalanced data.
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Metric choice tied to the business problem.
Key points a strong answer covers
- Accuracy misleads. Accuracy misleads on imbalanced data.
- Precision & recall. Precision and recall, depending on the cost of each error type.
- F1 / PR-AUC / ROC-AUC. F1, PR-AUC (better for rare classes), ROC-AUC.
- Threshold & business cost. Pick a threshold based on business costs.
- Handling imbalance. Class weights or resampling.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Reporting 99% accuracy on a 1% fraud dataset.
- Ignoring the decision threshold.
Likely follow-up questions
- When is recall more important than precision?
- Why can ROC-AUC look good on very imbalanced data?
Example strong answer
I start from the cost of each kind of error. With imbalanced data accuracy is misleading — if 1% of transactions are fraud, predicting 'not fraud' every time is 99% accurate and useless. So I look at precision — of the cases we flag, how many are right — and recall — of the real cases, how many we catch. For fraud or medical screening, missed cases are expensive, so recall matters more, with precision kept high enough that reviewers aren't overwhelmed. I use the precision-recall curve and PR-AUC, which is more informative than ROC-AUC for rare classes, then choose the decision threshold with the business based on the costs. Class weights or resampling can help the model learn the minority class.
3.
How do you approach feature engineering?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Practical modelling skill.
Key points a strong answer covers
- Domain understanding. Start from domain knowledge and hypotheses.
- Transformations. Scaling, log transforms, encoding categories, date parts, interactions.
- Missing values. Impute missing values and add missing indicators.
- Avoid leakage. Avoid leakage: only use information available at prediction time; fit transforms on training data.
- Validate value. Check features actually improve validation performance.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Using features that wouldn't exist at prediction time.
- Fitting scalers on the full dataset.
Likely follow-up questions
- Give an example of target leakage.
- How would you encode a category with 10,000 values?
Example strong answer
I start with domain understanding — what drives the outcome — and form hypotheses, then turn raw data into signals. For churn, that might be days since last login, trend in usage over the last four weeks, number of support tickets, and plan changes. Typical transformations: log-transforming skewed amounts, extracting day of week or month from dates, encoding categories with one-hot or target encoding for high cardinality, and interaction features. Missing values are imputed, often with an indicator flag because missingness can be informative. The biggest risk is leakage, so every feature must be computable at prediction time, and transformations are fitted only on the training data inside a pipeline. I keep features that improve validation performance and drop the rest.
4.
How do you choose which model to use for a problem?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Pragmatism and trade-off thinking.
Key points a strong answer covers
- Baseline first. Start with a simple baseline.
- Data type & size. Consider the data type and size: gradient boosting for tabular, deep learning for images/text.
- Interpretability. Interpretability requirements.
- Operational constraints. Latency, cost and maintenance constraints.
- Compare with validation. Compare candidates on a proper validation setup.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Jumping straight to deep learning for small tabular data.
- No baseline to compare against.
Likely follow-up questions
- Why do gradient-boosted trees often win on tabular data?
- When would you accept a less accurate but more interpretable model?
Example strong answer
I always start with a simple baseline — a heuristic or logistic regression — so I know what 'good' means. Then I consider the data: for structured tabular data, gradient-boosted trees like XGBoost or LightGBM are usually the strongest; for images, audio or text, deep learning or pre-trained models. Interpretability matters a lot in credit or healthcare, where a slightly less accurate but explainable model can be the right call. Operational constraints count too: latency, inference cost, how often it must retrain, and who will maintain it. I compare candidates on the same cross-validation setup and metric, and I prefer the simplest model that meets the requirement.
5.
What changes when you take a model from a notebook to production?
AdvancedTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
MLOps awareness: what it takes for a model to keep working after the notebook.
Key points a strong answer covers
- Reproducible pipelines. Reproducible training pipelines with versioned data, code and models.
- Serving. Batch or real-time serving with latency requirements.
- Monitoring & drift. Monitor inputs, predictions and performance for drift.
- Retraining. Retraining on a schedule or trigger.
- Testing & rollout. Tests, shadow/canary rollouts and rollback; fairness checks.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Training and serving features computed differently.
- No monitoring after deployment.
Likely follow-up questions
- What's training–serving skew?
- How would you detect that a model has degraded?
Example strong answer
A notebook proves an idea; production needs reliability. Training becomes a reproducible pipeline with versioned data, code and model artefacts, so any model can be rebuilt. Features must be computed the same way at training and serving time, otherwise you get training–serving skew — a feature store or shared code helps. Serving is either batch scoring or a real-time API with latency and scaling requirements. Before full rollout I'd run the new model in shadow mode or as a canary against the current one. After launch I monitor input distributions for data drift, prediction distributions, and actual performance as labels arrive, with alerts and a retraining schedule or trigger — plus checks for bias across groups.
6.
Explain a machine learning model to a non-technical stakeholder.
IntermediateHRPractise this question and get feedbackWhat the interviewer is evaluating
Communication of complex ideas.
Key points a strong answer covers
- Plain language. Plain language and an analogy.
- What it does & doesn't. What it predicts and its limits.
- Business impact. What it means for their decisions.
- Trust & drivers. The main drivers, with a concrete example.
Suggested answer structure
- Answer directly in one or two sentences.
- Back it up with one specific example.
- Connect it to this role and this company.
Common mistakes
- Explaining the algorithm instead of the outcome.
- Overselling accuracy.
Likely follow-up questions
- How would you explain a false positive?
- How do you build trust in a model's recommendations?
Example strong answer
I focus on what it does for them, not how it works. For a churn model I'd say: 'Every week it looks at how each customer has been using the product — logins, support tickets, plan changes — and gives each a score for how likely they are to cancel in the next month. It's like an experienced account manager's gut feeling, but applied consistently to all 20,000 customers.' I'd explain the main drivers with a real example, be clear it's a probability, not a certainty — of the 100 customers it flags as highest risk, about 40 would cancel without action — and connect it to their decision: which customers the success team should call first. Then I'd suggest measuring whether those calls actually reduce churn.
7.
Explain p-values and confidence intervals in simple terms.
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Statistical literacy.
Key points a strong answer covers
- p-value meaning. The probability of results at least this extreme if there were no real effect.
- Not the probability it's true. It's not the probability that the hypothesis is true.
- Confidence interval. A range of plausible values for the true effect.
- Practical significance. Statistical significance isn't practical significance.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Saying a p-value is the probability the null hypothesis is true.
- Ignoring effect size.
Likely follow-up questions
- Why is a confidence interval often more useful than a p-value?
- What does 'statistically significant' not tell you?
Example strong answer
A p-value answers: if there were really no effect, how surprising would results at least this extreme be? A p-value of 0.03 means that, assuming no real difference, we'd see a difference this big about 3% of the time by chance. It is not the probability that our hypothesis is true or false — that's the most common misreading. A confidence interval gives a range of plausible values for the true effect: 'the new page lifts conversion by between 0.5 and 2.5 percentage points', at 95% confidence. I find intervals more useful because they show the size and uncertainty of the effect, and a statistically significant result can still be too small to matter for the business.
8.
How would you evaluate an application built on a large language model?
AdvancedTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Modern ML evaluation practice.
Key points a strong answer covers
- Define tasks & criteria. Define the tasks and what good looks like.
- Evaluation set. Build a representative evaluation set with expected outputs.
- Automated + human. Automated checks, model-graded rubrics validated by human review.
- Failure modes. Hallucination, safety, bias, prompt injection.
- Monitor in production. Monitor quality, cost and latency; regression-test prompt and model changes.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Judging quality from a handful of manual chats.
- No regression tests when prompts change.
Likely follow-up questions
- How do you validate an LLM-as-judge grader?
- How would you test for prompt injection?
Example strong answer
I'd define the tasks and success criteria first — for a support assistant: correct, grounded in our help articles, polite, and escalating when unsure. Then build an evaluation set of realistic inputs, including hard and adversarial cases, with expected answers or rubrics. Some checks are automatic: format, citations to real sources, refusing out-of-scope requests. For open-ended quality I'd use model-graded rubrics, but validate them against human ratings on a sample. I'd specifically test failure modes: hallucinations, unsafe content, bias and prompt injection. Every prompt or model change runs against the eval set as a regression test, and in production I monitor user feedback, escalation rates, cost and latency.
9.
Tell me about a data science project from start to finish.
IntermediateBehaviouralPractise this question and get feedbackWhat the interviewer is evaluating
End-to-end ownership and impact.
Key points a strong answer covers
- Problem framing. The business problem and how you framed it.
- Data & approach. Data, features and approach.
- Your role. What you did personally.
- Result & impact. The measurable outcome.
- Learning. What you learned.
Suggested answer structure
- Situation — one or two sentences of context.
- Task — what you were responsible for.
- Action — what you did, step by step (say “I”).
- Result — what changed, with a number if you can back it up.
- Reflection — what you learned or would do differently.
Common mistakes
- Focusing on the algorithm and not the business outcome.
- No clear personal contribution.
Likely follow-up questions
- What would you do differently?
- How did you know the model was good enough to ship?
Example strong answer (a fictional story — use your own)
At a subscription meal-kit company, retention was falling and the team wanted to know whom to target with offers. I framed it as predicting which customers would cancel within 30 days. I owned the project with an analyst from marketing. I built features from order history, skips, delivery issues and support contacts, started with a logistic regression baseline, and moved to LightGBM, which improved PR-AUC from 0.31 to 0.44. The key insight was that two consecutive skipped weeks was the strongest signal. We ran a randomised test: customers flagged and offered a flexible pause cancelled 18% less than the control group. I'd involve the marketing team earlier next time, because designing the intervention took longer than the model.
Ready to answer them out loud?
Run a timed data scientist mock interview, type or speak your answers, and get a score breakdown with what to improve.