Home/Interview questions/Data Science Bootcamp
Interview prep · 11 IT courses · 98 questions

9 Data Science interview questions and answers

Questions that come up in technical interviews, with model answers. Try answering out loud first, then open the question to compare.

Q01What is overfitting, and how do you detect it?Machine learningBasic

The model learns noise in the training data instead of the pattern, so it scores well on training data and badly on new data.

Detect it by comparing training and validation scores, using cross-validation or learning curves. Fix it with more data, a simpler model, regularisation, early stopping or fewer features.

Q02Explain the bias–variance trade-off.StatisticsBasic

High bias means the model is too simple and underfits. High variance means it is too sensitive to the training data and overfits.

Expected error is roughly bias² + variance + noise that no model can remove. Choose the model complexity that gives the lowest validation error.

Q03What is the difference between precision and recall, and when do you favour each?EvaluationBasic

Precision = TP / (TP + FP): of the cases you flagged, how many were right. Recall = TP / (TP + FN): of the real cases, how many you caught.

Favour recall when missing a case is costly, such as disease screening or fraud. Favour precision when false alarms are costly, such as a spam filter. F1 is their harmonic mean; the decision threshold moves the balance.

Q04Why is accuracy misleading on imbalanced data, and what do you use instead?EvaluationIntermediate

If 99% of rows are negative, a model that always predicts negative scores 99% accuracy while catching nothing.

Use the confusion matrix, precision, recall, F1 and PR-AUC. Handle the imbalance with class weights, resampling and a tuned decision threshold.

Q05What is data leakage, and how does cross-validation help avoid it?ValidationIntermediate

Leakage is when the model sees information during training that it won't have at prediction time: future data, features derived from the target, or scaling fitted on the full dataset.

In k-fold cross-validation, fit all preprocessing inside each fold, for example with a scikit-learn Pipeline. For time series, split by time instead of shuffling.

Q06What is the difference between L1 and L2 regularisation?Machine learningIntermediate

L1 (lasso) adds the sum of absolute weights to the loss and pushes some weights to exactly zero, so it also selects features.

L2 (ridge) adds the sum of squared weights and shrinks all weights smoothly, which handles correlated features well. Elastic net combines both.

Q07How does a random forest differ from gradient boosting?ModelsIntermediate

A random forest trains many deep trees independently on bootstrap samples and random feature subsets, then averages them. It mainly reduces variance and works well with little tuning.

Gradient boosting trains shallow trees one after another, each fitting the errors of the previous ones. It mainly reduces bias, is often more accurate, and needs careful tuning of learning rate and number of trees to avoid overfitting.

Q08How would you design and analyse an A/B test?ExperimentsAdvanced

Define one primary metric and the hypothesis. Calculate the sample size from the baseline rate, the minimum effect worth detecting, power (usually 80%) and significance level (usually 5%).

Randomise by user, run the full planned duration, and check that the split between groups matches the plan. Analyse with a suitable test, such as a two-proportion z-test, and report the effect with a confidence interval. Don't stop early because results look good, unless you planned a sequential test.

Q09A model's accuracy drops a month after deployment. How do you investigate?MLOpsAdvanced

First rule out pipeline bugs: missing features, changed units, schema changes.

Then compare live feature distributions with training data to find data drift, and check whether the relationship between features and labels has changed (concept drift). Break errors down by segment, retrain on recent data if needed, and add monitoring and alerts so you catch it sooner next time.

SIGNAL

These topics are taught in full in Data Science Bootcamp, a live cohort starting soon (date to be announced) · ₹45,000.

View course

Get new batch dates first

One email when a cohort opens, plus free interview questions. No spam.

Chat on WhatsApp