Machine Learning Fundamentals interview question · Most asked

Design a system that serves predictions from a trained model to a web application.

Design Asked in Machine Learning Engineer interviews

Members can save this page, take notes and track progress. See membership · Sign in

Summary

Package the model with its preprocessing as a versioned artifact, serve it behind an API (or batch-score into a table if predictions can be precomputed), fetch online features from a low-latency store, log every request and prediction, and deploy new versions with shadow or canary traffic. Monitor latency, errors, drift and business outcomes.

Longer Answer

  • Batch vs online: precompute daily recommendations into a table if freshness allows; online inference when predictions depend on the current request.
  • Serving: FastAPI or a model server (Triton, TorchServe, BentoML, SageMaker endpoints) in containers with autoscaling; GPUs only where needed.
  • Features: a feature store or cache (Redis) for online features, computed by the same code as training.
  • Registry: MLflow or a cloud registry with versions, metrics and lineage to the training data.
  • Rollout: shadow traffic to compare outputs, then canary with business metrics; easy rollback.
  • Reliability: timeouts and a fallback (a simpler model or a rule) if the model service fails.
  • Feedback loop: log features, predictions and outcomes for monitoring and retraining.

Key Points

  • Batch when you can, online when you must.
  • Version model plus preprocessing together.
  • Consistent features for training and serving.
  • Shadow and canary rollouts; fallbacks.
  • Log everything for monitoring and retraining.

Explanation

What interviewers look for

End-to-end thinking: features, versioning, rollout, monitoring and fallbacks, not just 'wrap it in Flask'.

More Machine Learning Fundamentals questions

← All Machine Learning Fundamentals questions

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake