Interview questions

Machine Learning Engineer Interview Questions and Answers

The 16 questions that come up in Machine Learning Engineer interviews, what each one tests and how to answer it, with 6 sample answers.

By Olive Jobs · Updated October 26, 2026

How these interviews run

Machine learning engineer loops usually look like a software engineer loop with ML added: one or two coding rounds, a discussion of ML fundamentals, and an ML system design round where you take a problem such as recommendations or fraud from data to deployment and monitoring, plus behavioral questions. Teams building on large language models often add questions on retrieval, evaluation, and the cost and latency of serving models.

What interviewers look for

ML fundamentals
You explain overfitting, regularization, evaluation metrics and common model families in plain terms, and say when each one matters in practice.
Data judgment
Interviewers probe whether you spot label problems, class imbalance and leakage, and whether you split data the way the model will meet it in production.
ML system design
You frame a vague product goal as an ML problem, choose a metric, start from a baseline, and cover features, serving latency and monitoring.
Production engineering
Coding rounds and project deep dives check that you write clean, tested code and have shipped models that other systems depend on.
Measuring impact
You connect model metrics to the business outcome, and you know offline gains only count once an online test confirms them.

ML fundamentals

Conceptual questions that check you understand why models behave as they do, not just which library call to make.

  1. 01

    Explain the bias-variance trade-off. How would you tell which one is hurting your model?

    Why they ask it: It is the core diagnostic skill in applied ML, and the answer shows whether you debug models from evidence.

    How to answer

    • Define both briefly: bias is error from a model too simple for the pattern; variance is error from fitting noise in the training data.
    • Give the diagnosis: high training and validation error points to bias; low training error with much higher validation error points to variance.
    • Name remedies for each: more features or capacity for bias; more data, regularization, a simpler model or early stopping for variance.
    • Mention learning curves as the tool that shows which case you are in.
    Sample answer

    Bias is error from a model that's too simple to capture the real pattern, and variance is error from a model that has learned noise in its particular training set. In practice I diagnose it by comparing training and validation error. If both are high and close together, the model is underfitting, so I'd add better features, use a more flexible model, or loosen regularization. If training error is low but validation error is much higher, it's overfitting, so I'd get more data, add regularization, simplify the model or stop training earlier. Learning curves help a lot here: if validation error is still dropping as I add training data, more data is worth collecting. If both curves have flattened at a high error, more data won't help and I need a better model or features.

    Avoid: Reciting the textbook definition without saying how you would detect either problem in a real model.

  2. 02

    Your fraud model has 99 percent accuracy. Is it a good model?

    Why they ask it: It tests whether you recognize class imbalance and choose metrics that reflect the real cost of mistakes.

    How to answer

    • Point out that with rare fraud, predicting 'not fraud' for everything can score higher than 99 percent accuracy.
    • Switch to precision and recall on the fraud class, and the precision-recall curve rather than accuracy.
    • Tie the decision threshold to costs: a missed fraud versus a blocked legitimate customer.
    • Ask how the labels are produced, since fraud labels often arrive weeks later through chargebacks.
    Sample answer

    Not necessarily, and I'd want to know the fraud rate before reading anything into it. If half a percent of transactions are fraud, a model that never flags anything is 99.5 percent accurate and completely useless. I'd look at precision and recall for the fraud class instead, and at the precision-recall curve, which is more informative than ROC when positives are this rare. Then the real question is where to set the threshold, which is a business decision: each missed fraud costs the transaction amount, while each false alarm costs a declined good customer and maybe a support call. I'd work with the fraud team to put rough costs on both and pick the threshold that minimizes total cost. I'd also check how labels are created, because chargebacks can arrive weeks later, so recent data looks cleaner than it is.

    Avoid: Accepting accuracy as the metric for an imbalanced problem.

  3. 03

    What is data leakage? Give an example you would watch for.

    Why they ask it: Leakage is the most common reason a model looks great offline and fails in production.

    How to answer

    • Define it: information available during training that will not be available at prediction time.
    • Give concrete examples: a feature computed after the outcome, the same customer in both train and test sets, or scaling fit on the full dataset before splitting.
    • Explain the defense: split by time when predicting the future, split by entity when rows are related, and fit preprocessing on training data only.
    • Treat a suspiciously good result as a reason to look for leakage.

    Avoid: Splitting time-dependent data randomly and calling the validation score reliable.

  4. 04

    How does regularization work, and when would you use L1 versus L2?

    Why they ask it: It checks that you understand how models are kept from overfitting, beyond turning a hyperparameter knob.

    How to answer

    • Explain that regularization adds a penalty on model complexity, usually on the size of the weights, to the loss.
    • L1 can push weights exactly to zero, which acts as feature selection; L2 shrinks all weights smoothly and copes better with correlated features.
    • Mention neural network equivalents: weight decay, dropout, early stopping, data augmentation.
    • Say you tune the strength on validation data, not the test set.

    Avoid: Saying regularization always improves a model; too much causes underfitting.

  5. 05

    How do gradient-boosted trees differ from a random forest?

    Why they ask it: Tree ensembles are still the default for many tabular problems, so interviewers check you know how they work and when to use each.

    How to answer

    • Random forest: many deep trees trained independently on bootstrap samples with random feature subsets, averaged to reduce variance.
    • Boosting: shallow trees trained in sequence, each fitting the errors (gradients of the loss) of the ensemble so far, which mainly reduces bias.
    • Boosting usually wins on accuracy but needs tuning (learning rate, depth, early stopping); random forests are harder to overfit by adding trees.
    • Mention when you would pick each for a real problem.

    Avoid: Describing them as the same thing with different library names.

ML coding

Besides standard algorithm problems, many loops ask you to implement a small piece of ML from scratch to show you understand the math.

  1. 06

    Implement k-means clustering with NumPy.

    Why they ask it: It is short enough for an interview and shows whether you can turn an algorithm into clean, vectorized code.

    How to answer

    • Describe the loop: initialize k centroids, assign each point to its nearest centroid, move each centroid to the mean of its points, repeat until assignments stop changing.
    • Vectorize the distance computation instead of looping over every point and centroid.
    • Handle edge cases: an empty cluster, and a maximum iteration count.
    • Mention k-means++ initialization and multiple restarts, since the result depends on the starting centroids.

    Avoid: Writing nested Python loops over every point and centroid when the interviewer asked for NumPy.

  2. 07

    Implement scaled dot-product attention.

    Why they ask it: Teams working on transformer models use it to check that you understand the building block rather than only calling a library.

    How to answer

    • State the formula: softmax of Q times K transposed, divided by the square root of the key dimension, multiplied by V.
    • Explain the scaling: without it, large dot products push softmax into regions with tiny gradients.
    • Apply a mask by setting disallowed positions to a large negative value before the softmax (for example, future tokens in a decoder).
    • Make the softmax numerically stable by subtracting each row's maximum, and check the output shapes.

    Avoid: Applying the mask after the softmax, which leaves the weights summing to the wrong total.

ML system design

Open-ended prompts that test whether you can take a product goal to a working, measurable system in production.

  1. 08

    Design a system that recommends products on an online store's home page.

    Why they ask it: Recommendations are the most common ML design prompt, covering framing, data, modeling, serving and evaluation in one problem.

    How to answer

    • Clarify the goal and metric first: clicks, purchases or long-term revenue, and the latency budget.
    • Use two stages: cheap candidate generation (co-purchase, embeddings, popularity) that narrows millions of items to hundreds, then a ranking model.
    • Describe training data from impressions and clicks, and the biases in it, such as position bias and items never shown.
    • Evaluate offline (recall at k, NDCG) and then online with an A/B test, and plan for new users and new items.
    Sample answer

    I'd first agree on the objective. Clicks are easy to optimize but can reward clickbait, so I'd aim for purchases, with clicks as a supporting signal, and assume a budget of around 100 milliseconds. The design has two stages. Candidate generation pulls a few hundred items from several cheap sources: items often bought with the user's recent purchases, nearest neighbors in an embedding space, and trending items for users we know little about. A ranking model, likely gradient-boosted trees to start, then scores each candidate using user, item and context features. Training data comes from logged impressions, so I'd record the position each item was shown in, since top slots get clicked more no matter what's there. I'd check offline recall and NDCG, but only ship after an A/B test shows more purchases. New items get a small exploration share so they can earn data.

    Avoid: Jumping straight to a deep learning architecture before defining the metric and the data.

  2. 09

    How would you build a fraud detection model for card transactions?

    Why they ask it: Fraud combines heavy class imbalance, delayed labels, adversaries who adapt and a strict latency budget.

    How to answer

    • Note the constraints: decisions within milliseconds at checkout, labels that arrive weeks later, and fraud patterns that change.
    • Describe features computed in real time, such as transaction velocity per card and distance from usual location, and the store that serves them.
    • Address the feedback loop: blocked transactions never get a label, so keep a small, controlled holdout to measure what you block.
    • Monitor drift and retrain on a schedule, with rules as a fallback.

    Avoid: Ignoring that the model's own decisions change the data it will be retrained on.

  3. 10

    Your model beat the baseline offline, but the A/B test showed no improvement. What could be wrong?

    Why they ask it: It is one of the most common real situations in ML work, and the answer reveals how systematically you debug.

    How to answer

    • Check for training-serving skew: features computed differently online than in the training pipeline.
    • Check for leakage that inflated the offline score.
    • Ask whether the offline metric actually tracks the online goal.
    • Check the test itself: enough traffic to detect the effect, correct assignment and logging, and the model actually being served.
    Sample answer

    I'd work through it in order of how often each cause bites. First, training-serving skew. I'd log the features the live model actually received for a sample of requests and compare them with what the training pipeline computes for the same users. A time zone difference or a missing default value can quietly break a feature online. Second, leakage: if one feature carried information from after the prediction time, the offline gain was never real. Third, the metric itself: maybe we improved AUC on clicks but the test measured purchases, and those don't move together. Last, the experiment: was it powered to detect the lift we expected, and were users assigned and logged correctly? On a previous project the cause was skew. A user-history feature was computed from a nightly table offline but was missing for new sessions online, and fixing that recovered most of the expected lift.

    Avoid: Concluding the model is simply bad without checking the pipeline and the experiment.

  4. 11

    Design an assistant that answers employees' questions from internal documents using a large language model.

    Why they ask it: Retrieval-augmented generation is now a common ML engineering task, and it tests retrieval, evaluation and security judgment together.

    How to answer

    • Describe the retrieval pipeline: split documents into chunks, embed them, search with vector or hybrid keyword-plus-vector search, and rerank the results.
    • Pass the top passages to the model with instructions to answer only from them and cite sources.
    • Enforce document permissions at retrieval time, so nobody gets answers from files they cannot open.
    • Build an evaluation set of real questions with expected answers, measure retrieval and answer quality separately, and watch latency and cost per query.

    Avoid: Proposing fine-tuning to teach the model company facts that change weekly, when retrieval keeps answers current.

  5. 12

    How do you monitor a model after it ships?

    Why they ask it: Models degrade silently as data changes, so teams want engineers who plan for life after launch.

    How to answer

    • Watch input data: missing values, schema changes and shifts in feature distributions.
    • Watch outputs: the distribution of predictions and the share of positive decisions.
    • Track real performance once labels arrive, and system health such as latency and errors.
    • Define what triggers retraining or rollback, and who is alerted.

    Avoid: Monitoring only uptime and latency while the predictions quietly get worse.

Behavioral and project deep dives

Stories about models you shipped, trade-offs you made and how you worked with the people who use your systems.

  1. 13

    Tell me about a model you took to production. What was the impact?

    Why they ask it: Interviewers want proof you have carried a model past the notebook and can measure what it changed.

    How to answer

    • Set up the problem and the baseline you had to beat.
    • Explain your key decisions: data, features, model, and how it was served.
    • Give offline and online results with numbers.
    • Mention what broke after launch and how you handled it.
    Sample answer

    On my last team, support tickets were routed by keyword rules, and about a third landed in the wrong queue and had to be reassigned by hand. I built a text classifier to predict the right queue. I started with a TF-IDF and logistic regression baseline, which already beat the rules, then fine-tuned a small transformer that improved accuracy further on a held-out month of tickets. Latency mattered less than accuracy since routing could take a second, so I served it behind an internal API with a fallback to the rules if it timed out. After a two-week A/B test, misrouted tickets fell from roughly a third to under 15 percent, and first-response time dropped noticeably. Three months in, a new product launch created ticket types the model had never seen, so I added a low-confidence route to a human triage queue and a monthly retraining job.

    Avoid: Describing only the model architecture and never the outcome for users or the business.

  2. 14

    Tell me about a time a simpler approach beat a more complex model.

    Why they ask it: Good ML engineers reach for the simplest thing that works; this question checks whether you do.

    How to answer

    • Describe the complex approach you or the team considered and why it was tempting.
    • Show how you tested the simple baseline and what it achieved.
    • Explain the deciding factors: accuracy, latency, maintenance, explainability.
    Sample answer

    We wanted to forecast weekly demand for about 2,000 products, and the team's first plan was a deep learning model trained across all of them. Before building it, I set up two baselines: the same week last year scaled by recent growth, and a gradient-boosted model on calendar and price features. The boosted model came within a couple of points of error of the early deep learning prototype, trained in minutes instead of hours, and the planners could see which features drove each forecast, which mattered because they adjusted orders by hand. We shipped the boosted model. A year later it was still running with only routine retraining, and the time we saved went into fixing the promotion data, which improved accuracy more than any model change had.

    Avoid: Implying you never use complex models; the point is choosing based on evidence.

  3. 15

    Tell me about a time you had to explain a model's limitations to a non-technical stakeholder.

    Why they ask it: ML engineers regularly have to say what a model cannot do, and how you say it affects whether it is used safely.

    How to answer

    • Describe the stakeholder's expectation and the specific limitation.
    • Show how you explained it in their terms, with examples rather than metrics jargon.
    • Say what you agreed on, such as a human review step or a narrower scope.

    Avoid: Talking about the stakeholder as someone who simply did not understand.

  4. 16

    Do you want to build models or the systems around them, and why?

    Why they ask it: The roles overlap, so interviewers check that you want the engineering-heavy version of the work.

    How to answer

    • Name what you enjoy: getting models into production and keeping them reliable.
    • Back it with something you built end to end.
    • Connect it to the team's products and problems.

    Avoid: Saying the title sounded more senior or better paid.

Questions to ask them

The end of the interview is yours. Each of these tells you something about the job that a posting won't.

  1. How does a model get from experiment to production here, and who owns each step?

    It shows how mature the ML platform is and whether you will own deployment and monitoring.

  2. How do you decide a model is ready to launch, and how often do offline gains hold up in A/B tests?

    The answer reveals the team's experimentation discipline.

  3. What is the split between modeling work and data or infrastructure work in this role?

    Many ML engineering jobs are mostly pipelines; it is better to know up front.

  4. What compute and data access would I have in my first month?

    GPU availability and data permissions decide how quickly you can do real work.

  5. How is the team's impact measured?

    It tells you whether success is tied to product outcomes or only to model metrics.

How to prepare

  1. Practice standard coding problems as you would for a software engineer loop, plus small ML implementations in NumPy: k-means, logistic regression with gradient descent, softmax and attention, and evaluation metrics.
  2. Review fundamentals until you can explain them without notes: bias and variance, regularization, cross-validation, class imbalance, precision and recall, ROC and precision-recall curves, tree ensembles, and backpropagation.
  3. Rehearse two ML system design prompts, such as a recommender and a fraud or spam classifier, with one structure: goal and metric, data and labels, features, baseline, model, offline and online evaluation, serving, monitoring.
  4. If the team builds on large language models, prepare to discuss retrieval-augmented generation, evaluation sets, when fine-tuning helps versus prompting or retrieval, and cost and latency per request.
  5. Prepare two or three project deep dives with numbers: data size, baseline, offline metric gains, online results, latency, and what went wrong.
  6. Read the team's engineering blog, papers or product, and think about what models likely power it and how you would improve them.

Quick answers

What's asked in a machine learning engineer interview?

Usually coding (algorithm problems, sometimes implementing an ML algorithm in NumPy), ML fundamentals such as overfitting, metrics and data leakage, an ML system design round, and behavioral questions. Teams that build on large language models may add retrieval, evaluation and model-serving questions.

Do machine learning engineers need a PhD?

Usually not. Applied ML engineering roles generally ask for a bachelor's or master's degree in computer science or a related field plus strong engineering skills, while research scientist roles are more likely to expect a master's degree or PhD.

How is an ML engineer interview different from a data scientist interview?

ML engineer loops put more weight on coding and on designing production systems that serve and monitor models. Data scientist loops lean more on statistics, experiment design and product analytics.

How do I prepare for an ML system design interview?

Practice one repeatable structure on a few classic prompts: define the goal and metric, the data and labels, features, a simple baseline, the model, offline and online evaluation, then serving and monitoring. Say your trade-offs out loud as you go.

Sources

  1. Data Scientists (15-2051.00), O*NET OnLine
  2. Data Scientists, U.S. Bureau of Labor Statistics, Occupational Outlook Handbook
  3. Computer and Information Research Scientists, U.S. Bureau of Labor Statistics, Occupational Outlook Handbook

Keep going with Olive