What is the difference between batch-precomputed features and on-demand features computed at request time?

Quick Overview

Asks how features precomputed by scheduled batch jobs differ from features computed inside the prediction request. Tests latency, cost and freshness trade-offs, training-serving consistency, hybrid features that mix lookups with request data, and how to decide where each feature belongs.

What is the difference between batch-precomputed features and on-demand features computed at request time?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What is the difference between batch-precomputed features and on-demand features computed at request time? When would you use each in a production model? ```hint Timing and inputs For each kind, ask when the value is computed relative to the prediction, and what data exists at that moment. ``` ### What a Strong Answer Covers - When each kind of feature is computed and where its inputs come from. - The latency, cost and freshness trade-offs of each. - How training data is built for each kind so that training and serving compute the same values. - Hybrid features that combine a precomputed lookup with request data. - A rule for deciding which approach a given feature should use. ### Follow-up Questions - A feature like "number of card transactions in the last 10 minutes" is too fresh for a nightly job and too expensive to compute inside the request. How would you serve it? - How do you build training data for batch features so the model never sees a value from after the prediction time? - How would you detect training-serving skew in an on-demand feature after launch? - What should the model receive when an on-demand computation times out or a lookup misses?

Overview: Asks how features precomputed by scheduled batch jobs differ from features computed inside the prediction request. Tests latency, cost and freshness trade-offs, training-serving consistency, hybrid features that mix lookups with request data, and how to decide where each feature belongs.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

What is the difference between batch-precomputed features and on-demand features computed at request time? When would you use each in a production model?

What a Strong Answer Covers Guidance

  • When each kind of feature is computed and where its inputs come from.
  • The latency, cost and freshness trade-offs of each.
  • How training data is built for each kind so that training and serving compute the same values.
  • Hybrid features that combine a precomputed lookup with request data.
  • A rule for deciding which approach a given feature should use.

Follow-up Questions Guidance

  • A feature like "number of card transactions in the last 10 minutes" is too fresh for a nightly job and too expensive to compute inside the request. How would you serve it?
  • How do you build training data for batch features so the model never sees a value from after the prediction time?
  • How would you detect training-serving skew in an on-demand feature after launch?
  • What should the model receive when an on-demand computation times out or a lookup misses?