Data Scientist Interview Questions and Answers

Data science interviews mix four kinds of questions: statistics and probability, machine learning theory, hands-on coding in SQL and Python, and an open case where you design a model for a business problem.

Interviewers care less about naming algorithms than about trade-offs: why this model, how you'd know it works, and what could go wrong in production.

Data Scientist interview rounds

  1. Online test. Python or SQL problems, sometimes multiple-choice statistics and ML questions.
  2. ML and statistics round. Bias-variance, regularisation, metrics, a probability puzzle or two.
  3. Case / ML design round. Design a churn model or a recommender: data, features, model, metric, deployment.
  4. Project deep dive and HR. Your best project end to end, then team fit and expectations.

Machine learning interview questions

Explain the bias-variance trade-off.

Bias is error from a model too simple to capture the pattern (underfitting). Variance is error from a model too sensitive to the training data (overfitting). More complexity lowers bias but raises variance; you pick the level that minimises error on unseen data.

L1 vs L2 regularisation?

Both add a penalty on weights to reduce overfitting. L1 (lasso) penalises absolute values and can push weights to exactly zero, so it also selects features. L2 (ridge) penalises squares and shrinks weights smoothly.

How does a random forest work?

It trains many decision trees, each on a bootstrap sample of the rows and a random subset of features at each split, then averages (regression) or votes (classification). The randomness decorrelates the trees, which lowers variance.

Bagging vs boosting?

Bagging trains models independently on resampled data and averages them, reducing variance (random forest). Boosting trains models in sequence, each fixing the previous ones' errors, reducing bias (XGBoost, LightGBM).

How do you handle an imbalanced dataset?

Use the right metric first (precision, recall, PR-AUC, not accuracy). Then class weights, resampling (undersampling or SMOTE), and tuning the decision threshold for the business cost of each error.

Model evaluation interview questions

Precision vs recall?

Precision: of everything flagged positive, how much was right. Recall: of all real positives, how many were caught. Fraud detection usually favours recall; a spam filter favours precision so real mail isn't lost.

What does ROC-AUC measure?

How well the model ranks positives above negatives across all thresholds. 0.5 is random, 1.0 is perfect. With heavy imbalance, PR-AUC is often more informative.

Why use cross-validation?

To estimate performance on unseen data more reliably than one split, and to tune hyperparameters without touching the test set. For time series, use forward-chaining splits so the model never trains on the future.

What is data leakage?

When training data contains information that won't be available at prediction time, like a feature computed after the outcome, or scaling fitted on the full dataset. It makes offline scores look great and production results poor.

Statistics and probability interview questions

Explain the central limit theorem.

The mean of many independent samples tends toward a normal distribution, whatever the original distribution, as the sample size grows. It's why confidence intervals and many tests work on sample means.

Type I vs Type II error?

Type I is a false positive: rejecting a true null hypothesis. Type II is a false negative: missing a real effect. Lowering one usually raises the other unless you collect more data.

How would you design an A/B test?

Define the hypothesis and primary metric, compute the sample size from the minimum effect you care about, randomise users, run for full weekly cycles, avoid peeking, then check significance and guardrail metrics.

Python and SQL interview questions

How do you find and treat outliers in pandas?

Look with describe() and box plots, flag values outside 1.5×IQR or beyond a z-score threshold, then decide based on cause: fix errors, cap extreme values, or keep them if they're real and model them robustly.

apply vs vectorised operations in pandas?

Vectorised operations run in optimised C over whole columns and are far faster. apply runs a Python function row by row; use it only when there's no vectorised way.

Get the top 3 products by revenue in each category in SQL.

Rank inside each category with ROW_NUMBER() OVER (PARTITION BY category ORDER BY revenue DESC) in a CTE, then keep rows where the rank is 3 or less.

How Aptivo answers a Data Scientist question live

During a real interview, Aptivo hears the question and shows an answer built from your resume and the job, a few seconds after the interviewer finishes. Something like this:

InterviewerHow would you build a model to predict customer churn?

AptivoFirst I'd pin down churn: say, no purchase in 60 days. Then build features from behaviour before that window: recency, frequency, spend trend, support tickets, app usage. I'd start with logistic regression as a baseline, then gradient boosting. Because churners are a minority, I'd judge it on recall and PR-AUC, and pick the threshold with the retention team based on what an offer costs. Last, I'd check for leakage and monitor drift once it's live.

Read it, then say it in your own words. Answers mention your own projects when your resume has them.

Tips for your Data Scientist interview

  • For each project, be ready to explain the metric you chose and what you'd do differently.
  • Practise one ML case out loud in 10 minutes: problem, data, features, model, metric, deployment.
  • Revise probability basics: conditional probability, Bayes, expected value.
  • Keep SQL sharp; many data science rounds still start with a query.

Frequently asked questions

What machine learning topics are asked most?

Bias-variance, overfitting and regularisation, tree models and boosting, evaluation metrics, and handling imbalanced data. Deep learning comes up mainly for roles that list it.

Is DSA asked in data science interviews?

Usually lighter than for developers: Python problems on lists, dictionaries and strings, plus SQL. Some product companies add a standard coding round.

How do I answer the project question?

Problem, data, approach, result with a number, and one thing you learned or would change. Keep it to about two minutes, then let them ask.

Interview questions for other roles