Interview questions

Machine Learning Interview Questions

18 machine learning interview questions on fundamentals, evaluation, data leakage and production, with model-answer notes for candidates and interviewers.

Machine Learning Interview Questions

What's here

18 Machine Learning interview questions, grouped into 4 areas: core concepts, evaluation and metrics, data and features and production and judgement. Each one comes with why it is worth asking and what a strong answer contains, so the same question can be scored the same way by different interviewers.

  • Start with a concept question and follow up twice; memorised definitions rarely survive the second 'why'
  • Ask candidates to walk through a real project end to end, including how they split the data and chose the metric
  • Include one leakage scenario; spotting it unprompted is a strong signal
For hiring teams

Cohesyve finds, contacts and tests Machine Learning candidates on the real work, then ranks them for these interviews. 14-day free trial for 10 candidates, not charged until it ends.

Preparing for this interview yourself? Practise it free →

Machine learning interview questions test whether someone understands why models work and fail, beyond knowing which library call to make. Most ML interviews, for data scientist, ML engineer and applied scientist roles alike, cover the same ground: the core concepts, how to evaluate a model honestly, how data problems quietly ruin results, and what changes once a model is in production. Candidates can use the 'what to look for' notes as model answers; interviewers can use them as a scoring guide. For role-specific questions see our machine learning engineer interview questions.

Core Concepts

The fundamentals that every ML interview starts with. Strong candidates explain them plainly and with an example.

  1. 1

    What is the difference between supervised, unsupervised and reinforcement learning? Give an example of each.

    Why ask it

    A warm-up that shows whether the candidate can explain basics clearly to a non-specialist.

    What to look for

    Supervised learning fits a mapping from inputs to known labels (predicting churn from customer history). Unsupervised learning finds structure without labels (clustering customers into segments). Reinforcement learning learns a policy from rewards through interaction (a recommender or game agent). Good answers mention semi-supervised or self-supervised learning as hybrids.
  2. 2

    Explain the bias-variance trade-off.

    Why ask it

    The concept behind most modelling decisions, from model choice to regularisation.

    What to look for

    Bias is error from overly simple assumptions (underfitting); variance is error from sensitivity to the particular training sample (overfitting). Increasing model complexity usually lowers bias and raises variance. Strong candidates link it to practical levers: more data, regularisation, simpler or ensembled models, and reading training versus validation error curves.
  3. 3

    What is overfitting, how do you detect it and how do you reduce it?

    Why ask it

    Every practitioner meets it; the remedies show depth.

    What to look for

    Training performance much better than validation performance. Remedies: more or better data, regularisation (L1, L2, dropout), early stopping, simpler models, feature selection, data augmentation and cross-validation to tune. Bonus for noting that a validation set used repeatedly for tuning can itself be overfitted.
  4. 4

    What is the difference between L1 and L2 regularisation?

    Why ask it

    A precise technical question that separates memorised terms from understanding.

    What to look for

    Both add a penalty on weights to the loss. L1 (lasso) penalises absolute values and tends to push some weights to exactly zero, giving sparse models and implicit feature selection. L2 (ridge) penalises squared values and shrinks weights smoothly. Elastic net combines them. Features should be scaled for the penalty to be fair.
  5. 5

    How does a random forest differ from gradient boosting?

    Why ask it

    Tree ensembles dominate tabular work, so candidates should know both.

    What to look for

    Random forests train many deep trees independently on bootstrapped samples and random feature subsets, then average; this mainly reduces variance and is hard to overfit badly. Gradient boosting trains shallow trees sequentially, each fitting the errors of the ensemble so far; it mainly reduces bias, is often more accurate on tabular data, and needs more careful tuning (learning rate, depth, number of trees, early stopping).
For hiring teams

Before the Machine Learning interviews, see who can do the work

Cohesyve finds and contacts Machine Learning candidates from your job description and tests each one on an AI job simulation of the role, so these questions go to a ranked shortlist. 14-day free trial for 10 candidates, not charged until it ends.

Evaluation and Metrics

How the candidate decides whether a model is good enough, and for whom.

  1. 6

    When would you use precision, recall, F1 or ROC-AUC instead of accuracy?

    Why ask it

    Metric choice is where business sense meets statistics.

    What to look for

    Accuracy misleads on imbalanced data (predicting 'no fraud' for everything looks accurate). Precision matters when false positives are costly, recall when false negatives are costly, F1 balances them. ROC-AUC measures ranking quality across thresholds; precision-recall AUC is often more informative when positives are rare. Strong answers tie the metric to the decision the model drives.
  2. 7

    How do you set up cross-validation, and when is a random split the wrong choice?

    Why ask it

    Tests whether the candidate respects how data arrives in the real world.

    What to look for

    K-fold for i.i.d. data, stratified folds for imbalanced classes, group k-fold when several rows belong to one user or patient, and time-based splits for temporal data so the model never trains on the future. A random split on time series or grouped data leaks information and inflates scores.
  3. 8

    How would you handle a heavily imbalanced classification problem?

    Why ask it

    Fraud, churn and medical problems are usually imbalanced.

    What to look for

    Pick a suitable metric first, then options: class weights, resampling (undersampling, oversampling, synthetic methods) applied only inside training folds, threshold tuning on validation data, and collecting more positive examples. Mentions that calibration may need revisiting after resampling.
  4. 9

    Your offline metrics improved but the A/B test showed no gain. What could explain it?

    Why ask it

    Separates people who have shipped models from people who have only trained them.

    What to look for

    Offline metric does not match the business metric, training data differs from live traffic, leakage inflated the offline score, the test was underpowered or ran too briefly, novelty effects, or a serving bug (different feature computation online). A good candidate lists ways to check each.

Data and Features

Most ML failures are data failures. These questions test whether the candidate looks for them.

  1. 10

    What is data leakage? Give an example and explain how you prevent it.

    Why ask it

    Leakage is one of the most common reasons models look great offline and fail live.

    What to look for

    Leakage is using information at training time that will not be available at prediction time, which gives overly optimistic estimates. Examples: a feature recorded after the outcome, or scaling and feature selection fitted on the full dataset before splitting. Prevention: split first, fit preprocessing on training data only (scikit-learn's guidance is never to call fit on test data), and wrap preprocessing and model in a pipeline so each cross-validation fold is refit.
  2. 11

    How do you deal with missing values?

    Why ask it

    Everyday work that reveals judgement.

    What to look for

    First ask why values are missing (random, systematic, meaningful). Options: drop rows or columns, simple imputation (median, mode), model-based imputation, a missing-indicator feature, or models that handle missing values natively. Imputation should be fitted on training data only.
  3. 12

    How would you encode a categorical feature with thousands of distinct values?

    Why ask it

    A practical problem with several reasonable answers and some traps.

    What to look for

    One-hot encoding becomes huge and sparse. Alternatives: grouping rare categories, target encoding with out-of-fold estimates to avoid leakage, hashing, or learned embeddings. Strong candidates mention the leakage risk of naive target encoding.
  4. 13

    When would you scale or normalise features, and when does it not matter?

    Why ask it

    Checks understanding of how different algorithms use features.

    What to look for

    Scaling matters for distance-based and gradient-based models (k-NN, SVMs, linear models with regularisation, neural networks). Tree-based models split on thresholds and are largely insensitive to scaling. The scaler is fitted on training data and applied to test data.

Production and Judgement

What happens after the notebook, and how the candidate weighs trade-offs.

  1. 14

    How would you monitor a model after deployment?

    Why ask it

    Models degrade quietly; monitoring is the job of whoever ships them.

    What to look for

    Track input data drift, prediction distribution, live performance once labels arrive, latency and errors, and business KPIs. Set alert thresholds and a retraining or rollback plan. Good candidates mention checking that online features are computed the same way as in training.
  2. 15

    How would you explain a model's prediction to a non-technical stakeholder?

    Why ask it

    Interpretability matters for trust and, in some sectors, for regulation.

    What to look for

    Global explanations (feature importance, partial dependence) and local ones (SHAP or LIME style attributions for a single prediction), shown with plain language and examples. Honesty about the limits of these methods and about correlation versus causation.
  3. 16

    A simple logistic regression scores slightly lower than a large ensemble. Which would you ship?

    Why ask it

    Tests judgement beyond leaderboard thinking.

    What to look for

    It depends: weigh the size of the gain against latency, cost, maintainability, interpretability and the risk of the use case. Many strong candidates start with the simpler model as a baseline in production and upgrade only if the gain matters to the business.
  4. 17

    Describe an ML project that did not work. What did you learn?

    Why ask it

    Honest reflection is a strong signal of real experience.

    What to look for

    A specific project, a clear reason it failed (bad labels, wrong problem framing, leakage, no path to deployment), what they did about it and what they now do differently. Blaming others or claiming no failures are weak answers.
  5. 18

    How do you decide whether a problem needs machine learning at all?

    Why ask it

    Good practitioners know when not to use ML.

    What to look for

    Ask whether rules or simple heuristics solve it, whether enough quality labelled data exists, whether errors are tolerable, and whether the predictions will change a decision. Strong answers start with a baseline and a clear success metric.

Running the interview well

  • 1Start with a concept question and follow up twice; memorised definitions rarely survive the second 'why'
  • 2Ask candidates to walk through a real project end to end, including how they split the data and chose the metric
  • 3Include one leakage scenario; spotting it unprompted is a strong signal
  • 4Test the gap between offline and online results with a short case rather than a definition
  • 5Match the depth to the role: research roles need more maths, ML engineering roles more deployment and monitoring
  • 6Give credit for 'I would check' answers that name what they would check
  • 7Score judgement about when to use a simpler model as highly as knowledge of advanced methods

Common questions

What are the most common machine learning interview questions?

Expect the bias-variance trade-off, overfitting and regularisation, how specific algorithms work (linear and logistic regression, trees, random forests, gradient boosting), evaluation metrics for imbalanced data, cross-validation, data leakage, feature engineering and how you would monitor a model in production. Most interviews also ask you to walk through a project you built.

How should I prepare for an ML interview?

Revise the fundamentals until you can explain each one in two sentences with an example. Prepare two project stories covering problem framing, data, metric choice, results and what went wrong. Practise a short coding exercise in Python with pandas and scikit-learn, and be ready to discuss how you would deploy and monitor a model.

How much maths do ML interviews include?

It depends on the role. Applied and ML engineering roles usually test intuition: what a gradient is, why regularisation works, what a probability means. Research roles go deeper into linear algebra, probability and optimisation, and may ask you to derive a loss or update rule.

What is the difference between ML interview questions and ML engineer interview questions?

General ML questions test concepts and modelling judgement. ML engineer interviews add software engineering, system design for training and serving pipelines, and operational topics such as monitoring and retraining. Our machine learning engineer interview questions page covers those.

Should I mention large language models in an ML interview?

Only where relevant to the role. If the job involves LLMs, expect questions on prompting, retrieval, fine-tuning and evaluation. For most ML roles, a solid grasp of classical methods, evaluation and data quality matters more.

How do I answer an ML question I do not know?

Say what you do know, reason out loud from first principles and say how you would find out. Interviewers value a clear thinking process over a guessed answer.

For hiring teams

Save these questions for the Machine Learning candidates who can do the work

Cohesyve takes your Machine Learning job description, finds candidates, reaches out to them and runs an AI job simulation of the real work, then returns a ranked shortlist.

1,500+

assessments completed

50%

faster time-to-hire

5 min

from JD to assessment

14-day free trial · 10 candidates · Not charged until the trial ends

For job seekers

Preparing for a Machine Learning interview yourself? Practise on an AI job simulation of the role. 3-day free trial, cancel anytime.

Practise a Machine Learning interview free →

See Cohesyve in action

Free 30-min walkthrough

See it on your role