Machine Learning Engineer Interview Question

How do you decide between batch scoring and real time inference for a model?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Decide from freshness and the shape of the request. If the features and the population are known ahead of time and predictions stay valid for hours, precompute in batch and serve from a lookup table, which is simpler, cheaper, and far more reliable. Go real time when features depend on the current request, when the entity set is unbounded, or when staleness materially hurts the decision.

Why interviewers ask this

This is an architecture judgment question, and interviewers want to see you default to the simpler option. Plenty of candidates reach for a low latency service where a nightly job and a lookup would do, which multiplies operational cost for nothing. The strongest answers mention the hybrid pattern, precomputing heavy features in batch and combining them with request time signals.

How to structure your answer

  • Start from freshness requirements and feature availability.
  • Argue for batch as the cheaper default when it fits.
  • Name the conditions that force real time.
  • Offer the hybrid pattern as the common middle ground.

Example answer

Spoken example, first person

I start with two questions: how stale can the prediction be, and do I know who I am scoring in advance. For something like a weekly churn score over an existing customer base, both answers favor batch. I run a nightly job, write scores to a table, and serving becomes a primary key lookup that basically cannot fail. No accelerator on the request path, no cold starts, and if the job breaks I still have yesterday's scores, which is a much gentler failure than a timeout. Real time earns its keep when the features come from the request itself, like what the user just typed or what is in their cart right now, or when the entity might not exist yet, like a brand new session. Most systems I have built ended up hybrid: heavy aggregates computed in batch and cached, joined at request time with a handful of live signals, then scored. That keeps the online path cheap while still reacting to what just happened. The mistake I try to avoid is choosing real time for a nicer architecture diagram when nothing downstream actually consumes the freshness.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • How would you handle a batch job that fails halfway through?
  • What does the hybrid pattern cost you in complexity?
  • How do you keep batch and online feature computation from diverging?

Related machine learning engineer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot