Machine Learning Interview Questions and Answers
Prepare answers that explain the dataset, the baseline and why a result can be trusted.
Good machine learning answers explain how a model will generalise to new data. Define the prediction task, choose a defensible split, compare a baseline and measure errors that matter to the application.
Learning and generalisation
1. How do supervised and unsupervised learning differ?
Supervised learning uses examples with targets, such as a labelled category or a numerical outcome. Unsupervised learning looks for structure without those targets, such as clusters. A useful cluster still needs interpretation and evaluation; it is not automatically a meaningful business segment.
2. What is overfitting?
A model can fit training-specific patterns that do not hold on new examples. Compare performance on suitable held-out data, inspect learning behaviour and reduce unnecessary complexity. More data, regularisation or better features may help, but first check whether the evaluation split is valid.
3. Why start with a baseline?
A simple predictor establishes whether the proposed model adds useful information. For a forecasting task, a recent-value baseline may be meaningful; for classification, compare an appropriate simple classifier. A complex model should earn its additional maintenance cost.
Splits, cross-validation and leakage
4. Why keep a final test set?
Repeatedly choosing models on a dataset adapts decisions to that dataset. Use training data to fit, validation procedures to select, and an untouched test set for the final estimate where the study design permits. Do not treat test performance as independent after tuning against it.
5. When is a random split misleading?
It can leak information when related records appear in both sets or when future data helps predict the past. Use group-aware splits for related entities and time-aware splits for chronological prediction. The split should resemble the intended use.
6. What does cross-validation estimate?
It estimates performance across selected train-validation partitions. Its meaning depends on the splitting method and dataset. Report variation as well as the average, and avoid assuming that more folds fix a biased or unrepresentative dataset.
Sources: scikit-learn: cross-validation. Checked 23 October 2026.
Preprocessing without contamination
7. What is data leakage?
Leakage occurs when training or model selection uses information unavailable at prediction time. Examples include scaling on the whole dataset or using a field recorded after the outcome. Audit the data's timing and fit learned preprocessing only on training partitions.
8. Why use a preprocessing pipeline?
A pipeline keeps transformations and the estimator together, helping fit preprocessing within each training fold. It also reduces differences between training and prediction. It cannot detect every leakage problem, such as an inappropriate feature or a badly chosen split.
9. Does every model need feature scaling?
No. Distance-based and regularised models can be sensitive to scale, while tree-based methods usually do not require it for the same reason. Choose preprocessing for the estimator and data, then validate the complete pipeline.
Sources: scikit-learn: leakage and common pitfalls. Checked 23 October 2026.
Choosing and interpreting metrics
10. Why can accuracy hide a poor model?
On an imbalanced dataset, predicting the common class can produce high accuracy while missing the cases of interest. Inspect a confusion matrix, precision and recall, and relate mistakes to the application. Do not select a metric only because it looks favourable.
11. How do precision and recall differ?
Precision asks what fraction of predicted positives are correct. Recall asks what fraction of actual positives were found. Changing the decision threshold can trade one against the other. Discuss false-positive and false-negative costs before selecting that threshold.
12. What is the difference between MAE and RMSE?
Both describe regression error in the target's units. MAE averages absolute errors; RMSE takes the square root of mean squared errors and gives larger errors more influence. Inspect the error distribution and important slices as well as a single summary.
Sources: scikit-learn: model evaluation metrics. Checked 23 October 2026.
Explain one project end to end
Prepare a short account of the prediction target, dataset permissions, split, baseline, chosen metric and main failure cases. Describe one model or feature you rejected and the evidence behind that decision. This demonstrates judgement more clearly than reciting algorithm names.
For a churn model, ask when each feature becomes available and how churn is defined. A post-cancellation field may predict perfectly while being unusable. Explain how the model would reach a user and what evidence would show that it helps the actual workflow.
Common questions
Should I memorise every algorithm formula?
Understand the models relevant to your target role and practise their assumptions, tradeoffs and evaluation. Interview preparation should include reasoning about data and errors, not only formulas.
Are these questions an employer's official question bank?
No. They are original educational practice questions. Employer interviews vary by team, role and experience level.

