BetaJobprepping.com is in beta and still under construction. New sign-ups are closed.
Start practising
Machine Learning Engineer

How to Prepare for a Machine Learning Engineer Interview

How to prepare for a Machine Learning Engineer interview in 14 days, with daily drills, metric code to write, a story bank, timed mocks and a 3-day crash plan.

Updated

To prepare for a Machine Learning Engineer interview, spend two weeks rotating four kinds of practice: plain-Python coding on evaluation metrics and messy logs, ML system design spoken out loud against a timer, fundamentals you can explain without notes, and four or five true project stories with numbers. Take timed mock interviews of 30, 45 and 60 minutes at fixed points and fix what each one exposes.

The plan assumes about 75 minutes on weekdays and two hours on the three mock days (1, 7 and 11), which work best on a weekend or a day off. The Machine Learning Engineer interview guide has a shorter one-week version; this one adds worked numbers, reference code and timed drills. Pair it with the ML engineer interview questions and things to know before applying for an ML engineer job.

What do ML engineer interviews actually test?#

Weight your preparation towards the rounds on your invitation. At large consumer technology companies, candidate reports commonly describe a coding phone screen, then an onsite with two coding rounds, one or two ML system design rounds (usually a feed, recommender or ranking system) and a behavioural round, with senior candidates more often getting two design rounds. Smaller companies more often swap the algorithm round for a practical task, such as computing metrics from logs or fixing a training script.

Across the mix, interviewers listen for framing before modelling, suspicion of a large offline gain, features that match between training and serving, launches decided by A/B tests with guardrails, and ownership of monitoring and rollbacks after launch.

Ask the recruiter two questions before you start: "Is the coding round algorithmic or practical?" and "Is the design round a general system design or an ML system design?" The answers decide whether Days 3 and 8 (and Day 1 of the 3-day plan) lean towards data structures or towards metric code, and whether Days 4 and 9 are ML system design or general system design.

Before day 1, set up three things#

  1. A single prep document with four headings: stories, design prompts, fundamentals I fumbled, and mistakes I keep making.
  2. A Python file with only the standard library. Some ML coding rounds run in a plain-Python environment without numpy or pandas, so fluency with collections.defaultdict and sorted(..., key=...) matters; ask the recruiter.
  3. A design template for every drill: goal and constraints, label and metric, data and features, candidate generation, ranking, serving and latency, offline and online evaluation, monitoring and failure modes. The common failure is spending 20 minutes on architecture and never reaching evaluation; the checkpoints in Day 4 exist to stop that.

Week 1: what to study for an ML engineer interview (days 1-7)#

Week 1 is coverage: touch every competency once and build what week 2 sharpens.

Day 1, take a 30-minute mock cold#

Take a timed 30-minute mock before you prepare anything, to find your real weakest skill. Write down the moment you went quiet for longest, the question where you said "it depends" without saying on what, and the edge case you missed in the code.

Then map the job description. Copy each responsibility into your prep document and tag the round likely to probe it. "Own real-time ranking services" points at latency budgets and an incident question; "partner with data scientists on experimentation" points at A/B testing and a disagreement story. Any line you cannot tag to a story or drill is a gap to close.

Day 2, fundamentals you must say without notes#

Pick eight concepts and give each a 60-second spoken explanation with one concrete example. A good set for ranking and recommendation roles:

  • Precision, recall and why accuracy misleads on a 1% positive rate.
  • AUC versus log loss, and why calibration matters when a probability feeds an auction or a pricing rule.
  • Negative downsampling and how to correct predicted probabilities afterwards.
  • L1 versus L2 regularisation and what each does to feature weights.
  • Gradient-boosted trees versus a neural model for tabular features.
  • Data leakage, with one example from time and one from the label.
  • Training-serving skew, with one example from a feature computed differently online.
  • Cold start for new users and for new items.

Downsampling is the one candidates most often know in outline but cannot finish. If you keep negatives at rate w (say 0.1), the raw output p overstates the true probability, and you recalibrate with q = p / (p + (1 - p) / w). He and colleagues describe this in "Practical Lessons from Predicting Clicks on Ads at Facebook" (ADKDD 2014). Say it out loud with p = 0.5 and w = 0.1: q = 0.5 / (0.5 + 5), about 0.09.

Record yourself on two of the eight. If an explanation needs a whiteboard to make sense, it is not ready.

Day 3, write the metrics in plain Python#

Write recall at k and NDCG at k from scratch, then a time-based train and test split.

import math

def recall_at_k(ranked, relevant, k):
    if not relevant:
        return None  # decide and say this out loud: skip, or count as 0
    hits = len(set(ranked[:k]) & set(relevant))
    return hits / len(relevant)

def discount(position):  # position starts at 1
    return 1.0 / math.log2(position + 1)

def ndcg_at_k(ranked, relevant, k):
    wanted = set(relevant)
    gained = [discount(p) for p, item in enumerate(ranked[:k], start=1) if item in wanted]
    best = [discount(p) for p in range(1, min(len(wanted), k) + 1)]
    return sum(gained) / sum(best) if best else None

Then break it on purpose: duplicate items in ranked, fewer than k results, an empty relevant set. Write a three-line test for each. Explain aloud why the empty case is a product decision: averaging zeros for users with no positives drags the metric down and hides whether the model improved.

Day 4, your first ML system design drill#

Design a home-screen recommender for recipes or short videos in 25 minutes, out loud, hitting these checkpoints:

  • Minute 3: you have said what the label is (a click, a save, a 30-second view) and why.
  • Minute 8: you have named at least two candidate sources, such as embedding retrieval and recent popularity, narrowing millions of items to a few hundred.
  • Minute 15: you have a ranker and its features, and you have said how features are built point in time.
  • Minute 20: you have offline metrics, an A/B test design and at least one guardrail.
  • Minute 25: you have named two ways it breaks in production.

Then do a latency estimate. Suppose the page has a 200 ms budget at p99. Allow 20 ms for network and request parsing, 30 ms for retrieval from an approximate nearest neighbour index (such as HNSW in FAISS, or ScaNN) over two-tower embeddings, 25 ms for online feature lookups, 80 ms for ranking 500 candidates and 15 ms for re-ranking and business rules. That leaves 30 ms of headroom. Say what you would cut first if ranking took 150 ms: fewer candidates, a lighter first-pass model, or cached scores for logged-out users.

Day 5, build your story bank#

Write five stories from your own work. ML stories usually describe the model and skip the decision; this template forces the decision and the number.

Title:        (6 words max, e.g. "Leaky feature in churn model")
Context:      team, product, scale (users, rows, latency budget)
My role:      what I personally owned, in one sentence
Problem:      what was wrong or unknown, with a number
Options:      two or three paths I considered and why I rejected the others
Action:       what I did, in 3-4 steps, using "I"
Result:       metric movement, offline AND online if possible
What I'd change: one honest thing
Follow-ups I expect: 3 questions an interviewer would ask next

Aim for this mix:

  1. A model you shipped end to end, with the online result.
  2. A time offline and online results disagreed, and what you found.
  3. A data or pipeline bug you caught (leakage, a broken join, a silent schema change).
  4. A production incident or a model you had to roll back.
  5. A disagreement with a product manager or data scientist about a metric or launch.

A strong outline for story 2: "Our new ranker gained 4% NDCG offline but was flat in the A/B test. I suspected the logged labels, because they only covered items the old model had shown. I rebuilt the evaluation set from a small slice of randomised traffic, and the offline gain shrank to under 1%, which matched the test. Since then we keep a randomised slice for evaluation." The structure of suspicion, test and lasting change is what scores.

Day 6, statistics and experimentation#

Spend an hour on experiments. Cover, out loud:

  • Choosing the primary metric and guardrails before the test starts.
  • Why peeking daily inflates false positives, and what a fixed horizon or sequential method does about it.
  • Novelty and primacy effects on a two-week recommender test.
  • What a long-term holdout tells you that a test cannot.
  • Interference when users influence one another.

Then do one sample-size estimate by hand. The rule of thumb for 80% power at a 5% significance level is n ≈ 16σ²/δ² per arm. At a 5% click-through rate, σ² = 0.05 × 0.95 = 0.0475. Detecting a 2% relative lift means δ = 0.001, so n ≈ 16 × 0.0475 / 0.000001, about 760,000 users per arm. Then answer the follow-up: if traffic only allows 100,000 a week, run for several weeks, accept a larger minimum detectable effect, or reduce variance with a method such as CUPED. "Trustworthy Online Controlled Experiments" by Ron Kohavi, Diane Tang and Ya Xu (2020) covers both.

Day 7, the 45-minute mock and a review#

Take a 45-minute mock with a project deep dive and compare it with Day 1. Any skill that has not moved goes to the top of week 2. Make the "fundamentals I fumbled" list specific, such as "could not finish the probability correction after downsampling", not "stats".

Week 2: how to practise under interview time pressure (days 8-14)#

Same competencies, tighter clocks, harder variants.

Day 8, timed coding on messy logs#

Solve two problems that look like real ML plumbing, 18 minutes each, while talking:

  • Given event logs of (user_id, item_id, event, timestamp) in seconds, deduplicate repeated events within five seconds, then compute per-user click-through rate, excluding users with fewer than ten impressions.
  • Given interactions and a cut-off timestamp, build training and test sets with a one-day gap, so no training label overlaps the test window.

Check your first answer against this reference:

from collections import defaultdict

def ctr_per_user(events, window=5, min_impressions=10):
    last_kept = {}
    imps, clicks = defaultdict(int), defaultdict(int)
    for user, item, event, ts in sorted(events, key=lambda e: (e[0], e[1], e[2], e[3])):
        key = (user, item, event)
        # equal timestamps count as duplicates; say so before you code it
        if key in last_kept and ts - last_kept[key] < window:
            continue
        last_kept[key] = ts
        if event == "impression":
            imps[user] += 1
        elif event == "click":
            clicks[user] += 1
    return {u: clicks[u] / n for u, n in imps.items() if n >= min_impressions}

The window is measured from the last kept event, so a burst at 0, 4 and 8 seconds keeps the events at 0 and 8 (measuring from the last seen event instead would keep only the first); say that choice aloud. Then list the edge cases you missed: users only in the test window, time zones, a missing item ID (which also breaks the sort if it is None). If your coding round is algorithmic, swap one problem for a medium graph or heap problem.

Day 9, a harder system design#

Design a system with a twist, in 35 minutes. Good variants: a push-notification model where each user may receive at most two sends a day, or a fraud model where labels arrive 30 days late.

The twist is the point. With the send cap, a strong candidate says: "The model predicts the value of each notification, but the cap makes this an allocation problem, so I'd score the day's candidates, send the top two, and guard on unsubscribes, not just opens." With delayed labels: "Most fraud labels for last week aren't in yet, so I'd evaluate on a window at least 30 days old and monitor score distributions and early proxy signals meanwhile."

Day 10, pipelines and feature consistency#

Rehearse the data side. Explain aloud, with a drawn diagram:

  • How a point-in-time join works, and what goes wrong if you join today's feature values onto last month's labels.
  • How a feature store with offline and online stores, such as Feast or Tecton, keeps training and serving consistent, and where it still fails.
  • How you would backfill a new feature for two years of history without leaking.
  • What you log at serving time so you can rebuild exactly what the model saw.

Write the point-in-time join once. For each label row it takes the latest feature row stamped at or before the label time. DuckDB and Snowflake both have an as-of join (the example below is DuckDB syntax; Snowflake puts the time comparison in a MATCH_CONDITION clause); elsewhere, use ROW_NUMBER() over a window ordered by feature_ts descending.

SELECT l.user_id, l.label_ts, l.label, f.clicks_7d
FROM labels l
ASOF JOIN user_features f
  ON l.user_id = f.user_id AND l.label_ts >= f.feature_ts;

D. Sculley and colleagues at Google explain why this side matters in "Hidden Technical Debt in Machine Learning Systems" (NIPS 2015): the model code is a small fraction of a real system, and data dependencies, feedback loops and glue code are where much of the hidden technical debt builds up.

Day 11, the 60-minute mock#

Take the full 60-minute mock, including an incident scenario and a launch conversation with a non-specialist. Read the scorecard (or your own notes if you ran the mock with a friend) for any skill you would not yet call hire-ready, and rewrite the weakest two answers word for word, as you wish you had said them.

Day 12, production incidents and monitoring#

Run two 12-minute incident drills from prompts you wrote the night before, such as "Click-through on the home page dropped 8% overnight and nothing was deployed." Work in this order:

  1. Confirm it is real: is the drop in the metric or in the logging pipeline?
  2. Scope it: one platform, one country, new users only, one candidate source?
  3. Check inputs against last week: feature null rates, score distributions, upstream table freshness. Compare feature distributions with the population stability index (PSI); common rules of thumb treat PSI above 0.2 to 0.25 as a significant shift. Name where you would look, such as a Prometheus and Grafana dashboard for latency and null rates, and Great Expectations checks on upstream tables.
  4. Mitigate first: roll back to the previous model or switch off the broken source.
  5. Find the root cause and add the monitor that would have caught it earlier.

Saying "I'd roll back to yesterday's model while I investigate" in the first two minutes is worth more than a perfect root cause at minute eleven.

Day 13, fix the weakest area#

Use Day 11's review. Weak on design: redo one prompt from scratch. Weak on coding: redo both Day 8 problems without your notes. Weak on communication: explain a launch to an imagined product manager in two minutes with no ML terms, such as "The new model brings more listens per session but slightly less variety, so I'd launch it with a diversity rule and check the long-term holdout in a month."

Day 14, light review and questions#

Re-read your story bank and "mistakes I keep making" list. Prepare three ML-specific questions: how models get from experiment to production, who owns on-call for model services, and how an offline gain earns an A/B test slot. Rehearse your design opener, "Before I pick a model, can I confirm what we're optimising and how the prediction is used?", then stop early.

How to use the 30, 45 and 60-minute mocks#

Use each length for its own job rather than repeating the longest:

  • 30 minutes (Day 1): a mixed baseline across fundamentals, coding and a quick design, for diagnosis.
  • 45 minutes (Day 7): adds a project deep dive and a two-part coding exercise, testing stories under follow-ups.
  • 60 minutes (Day 11): the full loop with an incident and a non-specialist conversation, testing stamina.

With a peer, give them one prompt per segment, ask them to interrupt with "why?" at least three times, and record the call. Review each mock for as long as it lasted. You can also practise a timed 30, 45 or 60-minute Machine Learning Engineer mock interview with live coding and an AI interviewer, then compare scorecards across the fortnight.

How to prepare for a machine learning engineer interview in 3 days#

If you have three days, put most of the time into ML fundamentals and coding, the two rounds that most often end a loop early, and keep one design drill. On this site's scorecard those two are the must-haves.

Day 1 of 3#

Take a 30-minute mock cold. Write recall at k, NDCG and a time-based split in plain Python with tests for the edge cases, then speak the eight fundamentals from Day 2, including the downsampling correction.

Day 2 of 3#

Do one 30-minute ML system design drill with a latency budget and two failure modes. Write three stories: something you shipped, an offline and online mismatch, and an incident. Rehearse each in 90 seconds.

Day 3 of 3#

Take a 45 or 60-minute mock in the morning, rewrite your two weakest answers and run one incident drill. Stop by early evening.

What to read, and what to skip#

  • "Designing Machine Learning Systems" by Chip Huyen (O'Reilly, 2022): the chapters on training data, evaluation, and distribution shifts and monitoring map onto design-round follow-ups.
  • Google's "Rules of Machine Learning" by Martin Zinkevich: its first rule, "Don't be afraid to launch a product without machine learning", gives you a crisp answer when asked for a baseline: a heuristic such as popularity or recency, shipped first and measured.

Skip certification study unless the job description asks for it. The Google Cloud Professional Machine Learning Engineer exam is two hours, 50 to 60 multiple-choice and multiple-select questions and $200 (plus tax), according to Google Cloud's certification page; it helps a cloud-heavy application but does not train you to defend a design out loud.

Frequently asked questions#

How long does it take to prepare for a machine learning engineer interview?#

Two weeks of daily practice is enough for most working engineers who already train or ship models. Allow three or four weeks if you have not written code under time pressure recently, or if your experience is mostly notebooks without production serving. Three days works only if you are already interviewing and need to focus on coding, fundamentals and one design drill.

What should I study first for an ML engineer interview?#

Start with whichever round a cold 30-minute mock shows is weakest, then cover ML fundamentals and practical coding, the two rounds that most often end a loop early. Being able to explain leakage, calibration, metrics for imbalanced data and training-serving skew, and to write ranking metrics in plain Python, carries over to almost every other round in the loop.

How do I practise ML system design on my own?#

Use a fixed template and a timer. Pick a product you know, such as a video feed or a search box, and talk through goal, label, candidates, ranking, serving, evaluation and monitoring in 25 to 35 minutes. Set checkpoints, for example a label by minute three, so you always reach evaluation and failure modes before time runs out.

How many mock interviews should I do before an ML engineer interview?#

Three timed mocks across two weeks works well: a 30-minute session cold on the first day, a 45-minute session with a project deep dive at the end of week one, and a full 60-minute session a few days before the interview. Spend as long reviewing each one as you spent in the session, and rewrite the weakest answers.

Do I need LeetCode for a machine learning engineer interview?#

Usually yes at large technology companies, which often run one or two medium-difficulty algorithm rounds, so keep hash maps, heaps, sorting and graphs fluent. Many other employers prefer practical tasks such as computing metrics from logs or building a leak-free split. Ask the recruiter which style to expect and weight your coding days accordingly.

Read next

GuideMachine Learning Engineer

Machine Learning Engineer Interview Questions and Prep Guide

How the machine learning engineer interview works, from ML fundamentals to recommender design and Python coding, with 9 practice questions and a 7-day plan.

QuestionsMachine Learning Engineer

Machine Learning Engineer Interview Questions, 24 Answered

24 Machine Learning Engineer interview questions by round, each with why it is asked, a strong answer outline, a weak answer to avoid and the follow-up.

ChecklistMachine Learning Engineer

Machine Learning Engineer Job, 16 Things to Know First

What to know before applying for a Machine Learning Engineer job, from daily work and must-have skills to pay, certifications, red flags and the interview loop.

Practice

Say it out loud.

Reading about an interview isn't the same as doing one. Take a 30, 45 or 60-minute Machine Learning Engineer interview with an AI interviewer and get scored against a real rubric.

Choose an interview