All specialtiesTechnology · Job interview

Machine learning

Machine learning interviews test ideas more than formulas. The challenge is to explain overfitting, metrics and leakage in plain spoken English, with one example for each.

Words → phrases → sentences → speaking

Try SpeakRole ↗
Job interviewMachine learning
V

How do you know a model is good enough to ship?

0:18
Interviewer question

Machine learning

Interviewers for machine learning roles usually mix theory with practical judgement. They ask what a method does, but also how you would know that a model is good, and what could go wrong between a notebook and a real product. Many candidates know the algorithms and forget the second part.

Use a simple spoken pattern: the idea in one sentence, a small example from a real problem, and the main risk. Do not start with the mathematics. If the interviewer wants the equation, they will ask, and your plain explanation will already have shown that you understand it.

  • ✓Words → phrases → sentences → speaking
  • ✓Answer meaning
  • ✓Language

Common questions and sample answers

What is the difference between supervised and unsupervised learning?

What the interviewer wants to hear. Labels versus no labels, one realistic example of each, and the point that evaluation and labelling cost are different.

Sample answer to practise aloud

In supervised learning, we have labelled examples: for each input, we know the right answer, and the model learns to predict it. Examples are predicting customer churn or marking emails as spam. In unsupervised learning, there are no labels, and the model looks for structure on its own, for example grouping customers into segments with clustering. Supervised results are easier to evaluate, because we can compare predictions with the truth. Unsupervised results need a person to judge whether the groups make sense. In practice, I first ask whether I have reliable labels, because getting good labels is often the hardest and most expensive part.

What is overfitting, and how do you deal with it?

What the interviewer wants to hear. A clear definition, how to detect it with a validation set, and several remedies, not only one.

Sample answer to practise aloud

Overfitting means that the model learns the training data too well, including its noise, so it works well on the training data and badly on new data. The sign is a big gap between the training score and the validation score. To detect it, I always keep a validation set or use cross-validation. To reduce it, I can collect more data, simplify the model, add regularisation, use early stopping or remove noisy features. For trees, I limit the depth. The opposite problem is underfitting: the model is too simple and is bad on both sets. I start with a simple baseline, so I know how much a complex model really adds.

How do you choose an evaluation metric for a classification problem?

What the interviewer wants to hear. Why accuracy can mislead on imbalanced data, precision versus recall, and a link to the cost of each mistake.

Sample answer to practise aloud

The right metric depends on the cost of each kind of mistake. Accuracy can be misleading when the classes are imbalanced. If only one percent of transactions are fraud, a model that always says "not fraud" is ninety-nine percent accurate and completely useless. So I look at precision and recall. Precision answers: of the cases I flagged, how many were correct? Recall answers: of all the real cases, how many did I find? For fraud or a medical test, I usually want high recall and accept more false alarms. For a spam filter, precision matters more, because blocking a real email is expensive. I choose the threshold together with the business.

What is data leakage, and how do you build features without it?

What the interviewer wants to hear. A concrete example, the habit of splitting first, time-based splits, and a question to ask about every feature.

Sample answer to practise aloud

Data leakage is when the model gets information during training that it will not have at prediction time. The result is a great score in the notebook and a poor result in production. A common example is a feature that is created after the event, like a refund flag when we predict churn. Another is fitting a scaler on the whole dataset before the split. So I split the data first and do all feature engineering inside a pipeline fitted on the training part only. For time-based problems, I split by time, not randomly. For every feature, I ask: will I know this value at prediction time?

How do you take a model to production and keep it healthy?

What the interviewer wants to hear. Packaging, serving style, safe release, monitoring of data drift, and a plan for retraining and rollback.

Sample answer to practise aloud

A model in a notebook is only the first step. For production, I package the model together with its preprocessing, version it, and serve it either as an API for real-time predictions or as a batch job. Before the release, I compare it with the current solution, often in shadow mode or with an A/B test. After the release, I monitor the service, like latency and errors, but also the input data and the predictions. The world changes, so the data can drift, and the quality drops silently. I set alerts, keep the option to roll back, and plan retraining. I also make sure that features are calculated in the same way in training and in serving.

How to say the key terms

overfitting
OH-ver-FIT-ing
precision
prih-SIZH-un
recall
REE-kawl
regularisation
reg-yuh-ly-ZAY-shun
gradient
GRAY-dee-ent
variance
VAIR-ee-uns
feature
FEE-cher

Useful phrases for answering

  • It depends on the cost of a false positive and a false negative.
  • First I would build a simple baseline.
  • The model works well on the training data but not on new data.
  • I would check for data leakage.
  • We measured it on a held-out test set.
  • The data may have drifted since we trained the model.
  • I would validate this with an experiment.

Common mistakes to avoid

  • Mixing up "feature" and "future". Feature is FEE-cher, future is FYOO-cher, and in this field you say "feature" all day.
  • Reading numbers unclearly. Say "zero point nine five" or "ninety-five percent", and watch the stress in fifteen (fifTEEN) and fifty (FIFty).
  • Quoting accuracy without mentioning the class balance. A high accuracy on imbalanced data may mean nothing.
  • Starting with a deep neural network for every problem. For many tabular problems, a simple model is a strong baseline, and saying so shows judgement.
  • Describing the model but never the business goal. Say what decision the prediction supports and how you would know it helped.

Frequently asked questions

How much mathematics do I need to explain?

You should be able to explain the intuition behind common models and loss functions, and to describe gradient descent simply. Long derivations are more common in research roles than in applied ones.

Which tools should I mention?

Name the ones you really used, for example scikit-learn, PyTorch or XGBoost, and say how you tracked experiments and versions. A short honest list is better than a long one.

How do I talk about a project when the data is confidential?

Describe the problem type, the kind of data and your approach without names or exact figures. Focus on your decisions: how you split the data, which metric you chose and what you did when the first model failed.

Reading an answer is not the same as saying it. Practise each question out loud, then compare the meaning and the language of your own answer.

Try SpeakRole ↗

Other topics in this area