Machine Learning Fundamentals interview question · Most asked
Your model scored well offline but performs badly in production. What do you check?
Scenario Asked in Machine Learning Engineer interviews
Summary
Compare what the model sees in production with what it saw in training. The usual causes are training-serving skew (features computed differently), data drift (the input distribution changed), concept drift (the relationship changed), leakage that inflated offline scores, or a pipeline bug such as wrong feature order or units.
Longer Answer
- Log production inputs and predictions and compare feature distributions with training data (PSI, KS tests, summary statistics per feature).
- Recompute features offline for production requests and diff against the online values: skew shows up as mismatches.
- Check leakage in the offline evaluation (features unavailable at decision time).
- Look at segments: new markets, devices or customer types underrepresented in training.
- Label delay: production metrics may be computed on partial labels.
- Fix: shared feature code or a feature store, retraining on recent data, monitoring and alerts on drift, and shadow or A/B deployment before full rollout next time.
Key Points
- Training-serving skew is the most common cause.
- Monitor feature and prediction distributions.
- Re-check for leakage.
- Segment analysis; shadow deploys and retraining.
Explanation
What interviewers look for
A methodical comparison of training and serving, and production ML practices to prevent recurrence.
More Machine Learning Fundamentals questions
- Compare decision trees, random forests and gradient boosting.
- What is the difference between supervised, unsupervised and reinforcement learning?
- Explain the bias-variance trade-off.
- What is data leakage, and how do you detect it?
- Which metrics would you use for a classification model, and when is accuracy misleading?
- What is overfitting, and how do you prevent it?
- How do you split data for training, validation and testing, and what is cross-validation?
- Design a system that serves predictions from a trained model to a web application.