Skip to content
RED SAGSkills
mediumMachine Learning Engineer interview question

How do you decide between batch predictions and real-time (online) inference for a model?

What the interviewer wants to hear

  • Freshness needed: do predictions depend on very recent data
  • Latency and throughput needs
  • Cost and operational complexity
  • Batch precomputes for known entities; online handles new inputs
  • Hybrid approaches are common

Model answer

I start with the product need. If predictions can be a few hours old and the set of entities is known, like daily churn scores for all customers, batch inference is simpler and cheaper: run a scheduled job, write scores to a table and let other systems read them. If the prediction depends on what is happening right now, like fraud checks during payment or search ranking for a new query, I need online inference behind an API with tight latency limits. Online serving adds work: autoscaling, low-latency feature lookups, monitoring and fallbacks. Many systems are hybrid: batch-compute heavy features or candidate lists, then do a light online model at request time. I also consider cost per prediction, peak traffic and what happens if the model service is down, and design a safe fallback.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium Machine Learning Engineer questions