1. Find the k most frequent elements in a list (no libraries).
Use a dict for counts + heapq.nlargest, or Counter.most_common(k).
ML Engineer interviews sit between software engineering and modeling: coding rounds, ML system design, and deployment/MLOps. Below are real questions across those rounds, with answers.
An ML Engineer loop is a software engineering loop with modeling on top. It tests whether you can write correct, readable Python under time pressure, design a system that trains and serves a model reliably, explain the modeling choices inside it, and keep it working after launch. Modeling depth matters, but it is the engineering that fails candidates.
The system design round is where the role lives. The question is rarely which model. It is where the features come from, how training and serving stay consistent, what gets monitored, and what you do when the data drifts.
Recruiter screen, then a coding screen that looks like a general software one: data structures and algorithms in Python, sometimes with a data flavor. The onsite adds a second coding round, ML system design, an ML theory round (training, evaluation, regularization, the tradeoffs), an MLOps or deployment discussion, and a behavioral session. Research-leaning teams may add a paper or project deep dive.
The coding rounds are the filter. A weak coding screen ends the loop before anyone sees your modeling.
Coding: correctness, complexity stated, clean structure, tests considered. System design: the data path end to end, the training and serving split, how the model is evaluated offline and online, what is monitored, and how a rollback works. ML theory: the tradeoff behind each choice, said plainly. Deployment: latency, throughput, versioning, and how a bad model is caught before users see it.
A design answer with a monitoring and rollback story beats a more elaborate architecture without one.
Coding first, because it is the gate: timed Python problems until data structures are automatic. Then system design, practiced as full end-to-end walkthroughs of two or three systems you can draw from memory (a recommendation system, a fraud model, a search ranker), each with feature pipeline, training, serving, monitoring and rollback. Then ML theory as a review of tradeoffs, not definitions.
If the job post mentions a stack (Spark, SageMaker, Kubernetes), expect a question that uses it. Read enough to describe how it fits, not to configure it.
A coding round spent talking about models instead of writing code. A system design that has a model and no path for the data. Feature engineering that leaks the target. And describing deployment as pushing a pickle to an endpoint, with nothing about versions, monitoring, or what happens when it degrades.
Use a dict for counts + heapq.nlargest, or Counter.most_common(k).
Iterate with prev/curr pointers, reversing next at each step.
Bias is underfitting error, variance is overfitting error, and the goal is the lowest total generalization error.
Resampling (SMOTE/undersample), class weights, threshold tuning, PR-AUC over accuracy.
L1 (Lasso) drives weights to zero for sparsity and selection, L2 (Ridge) shrinks weights smoothly.
Bagged decision trees with feature subsampling, averaged or voted to reduce variance.
Check for features that use future or target information, fit transforms only on the training set, and audit unrealistically high scores.
Boosting fits trees sequentially on residuals to reduce bias, bagging trains them independently to reduce variance.
Randomize at user level, define engagement metric, guardrails, run long enough for novelty decay.
Offline (batch) + online (low-latency) stores, feature registry, point-in-time correctness.