Interview prep
Machine Learning Engineer
Trains, evaluates, and serves models, and knows when a prompt is enough.
These questions are representative practice, not from a specific company. Use them to rehearse how you think. A real interview will ask about your own work.
What are training, validation, and test sets for?
Hint. Each split answers a different question.
Reveal answerHide answer
Training data is what the model fits. Validation data is what you look at while you choose features, hyperparameters, and when to stop. The test set is touched once, to estimate how the frozen choice behaves on unseen data. If you tune on the test set, that number is no longer an honest estimate.
What is data leakage?
Hint. Information from the future, or from the label, sneaks into the features.
Reveal answerHide answer
Leakage is when the model sees something at training time that it will not have at prediction time, or a feature that is a copy of the answer. The score looks great and production looks ordinary. Check time order, joins, and any column that is filled in only after the outcome is known.
Why start with a simple baseline?
Hint. A fancy model needs something to beat.
Reveal answerHide answer
A baseline can be the current rule, the majority class, or a linear model. If a neural net does not beat it by enough to pay for the complexity, you should not ship the net. The baseline also tells you whether the label is even predictable from the features you have.
When do you care more about recall than precision?
Hint. Ask what a miss costs compared with a false alarm.
Reveal answerHide answer
Prefer recall when missing a positive case is expensive, such as a safety screen you will review by hand. Prefer precision when a false alarm is expensive, such as paging a person or blocking a payment. Report both, plus the threshold you chose, not a single accuracy number.
What does fine-tuning change, compared with prompting?
Hint. One changes weights. The other changes the request.
Reveal answerHide answer
Prompting leaves the weights alone and puts the task in the request. Fine-tuning updates weights on your examples, so the behavior persists without a long prompt. Fine-tune when you have enough labeled examples and a stable task. Prompt, or retrieve, when the facts change often or you have little data.
When is a smaller model the right choice?
Hint. Quality is not the only requirement.
Reveal answerHide answer
Use a smaller model when latency, cost, or on-device limits matter and a test set shows the quality drop is acceptable. A large model can still draft labels or hard cases. Measure the gap on your data. Do not assume the largest model wins the product.
How do you decide a new model version is safe to upgrade to?
Hint. Compare it on a fixed set, then on a small slice of live traffic.
Reveal answerHide answer
Run the old and new models on the same eval set, including the cases that failed last time. Check quality, refusals, latency, and cost. If the offline numbers hold, send a fraction of live traffic and watch real errors before you switch the default. Keep the old version ready to restore.
What is overfitting, and how do you spot it?
Hint. Great on the data it studied, worse on data it has not seen.
Reveal answerHide answer
Overfitting is when the model memorizes training quirks. Training loss keeps falling while validation loss rises or stalls. A large gap between training and validation scores is the usual sign. More data, simpler features, regularization, or earlier stopping are the usual responses.
How is an embedding different from generated text?
Hint. One is a vector for search. The other is words.
Reveal answerHide answer
An embedding is a list of numbers placed so similar inputs sit near each other. You use it to search, cluster, or dedupe. Generated text is the model writing tokens. An embedding does not answer a question by itself. A generator does not, by itself, tell you which document was closest.
How would you serve a model behind an API?
Hint. Cover batching, timeouts, and a way to roll back.
Reveal answerHide answer
Put a stateless service in front of the weights. Batch requests if the hardware likes it, set timeouts, and limit concurrency so one spike cannot take the GPU down. Log input hashes, model version, and latency. Ship a new version beside the old one and shift traffic only after the eval and a canary look calm.
Which metrics matter besides accuracy?
Hint. The product feels latency, cost, and the costly mistakes.
Reveal answerHide answer
Report the error that matches the decision: precision, recall, calibration, or a domain score. Add latency, throughput, and cost per request. For a model that writes text, add a task score and a check that it did not invent required facts. Accuracy hides rare but expensive misses.
How do you handle a rare class?
Hint. Do not let the common class define success.
Reveal answerHide answer
If 99 percent of rows are negative, a model that always says negative looks accurate and is useless. Measure recall on the rare class. You can rebalance the training sample, change the threshold, or collect more positive cases. Do not pick the model by overall accuracy.
What is a feature store for?
Hint. The training job and the live request should see the same computation.
Reveal answerHide answer
A feature store computes a feature once and serves the same definition in training and in production. That avoids the bug where the notebook used a column the API does not have. It also records when a feature was valid, which matters if the value changes over time.
How do you monitor a model after launch?
Hint. Watch the inputs, the outputs, and the outcomes you can actually observe.
Reveal answerHide answer
Track input distributions, output rates, latency, and error codes. Where you later learn the true label, track quality by segment. Alert on a sudden shift, not on every wiggle. Keep a sample of requests so you can debug. A dashboard that nobody has a threshold for is not monitoring.
Explain gradient descent without a long math lecture.
Hint. The loss is a hill. You step downhill.
Reveal answerHide answer
You score how wrong the model is. The gradient says which way each weight should move to reduce that score a little. You take a small step and repeat. The learning rate is the step size. Too large and you overshoot. Too small and training takes forever. That is the whole idea.
You and a teammate disagree on the metric. How do you settle it?
Hint. Tie the metric to a decision a person will make.
Reveal answerHide answer
Ask what action changes if the number moves. If two metrics would ship different models, pick the one that matches the cost of a miss versus a false alarm, and write that down. Then show both scores so the disagreement stays visible. Do not average them into a number nobody owns.