The interview question

Several ML teams need reusable features for training and real-time prediction.

Keep historical training joins and low-latency serving consistent through explicit timestamps and versions.

01. Define the feature contract

Start with entity keys, value types, event time, availability time, freshness requirements, ownership, and transformation versions. Reuse is valuable only when teams agree on what a feature means. A purchase count for a customer and a purchase count for a household are different contracts.

An offline store retains history for training and backfills. An online store serves current values with bounded latency. A registry tracks definitions and dependencies. These components do not automatically guarantee identical behavior; the transformation and publication semantics must make that true.

02. Make historical joins honest

Source events
Versioned features
Training & serving

For a prediction at 10:00, select only feature values that would have been available at 10:00. An event recorded as occurring at 09:58 but arriving at 10:05 was unavailable to the actual scorer. An event-time-only join may therefore be optimistic.

Preserve source arrival or publication history where needed, or explicitly state when a backtest assumes perfect timeliness. A feature TTL bounds how far back a historical join searches; it does not by itself solve every source of leakage or delayed ingestion.

03. Design writes and reads

Batch and stream computations publish values with entity, feature version, and ordering metadata. Online updates reject older values where the chosen ordering contract requires it. Scorers request a named feature set and receive values plus freshness and missingness information.

For ten million entities and 100 eight-byte values each, the raw current values use about 8 GB. Keys, metadata, serialization, indexes, replicas, and history add substantially. Grouping commonly fetched features can reduce round trips, but wide records may waste bandwidth for small models.

04. Operate backfills and failures

Backfills should write to a controlled version or staging area so historical recomputation does not overwrite fresh online state. Compare offline and online values on sampled prediction events. Monitor stale values, default rates, join coverage, and owner-defined quality checks.

Follow-up: two models require different freshness. Offer separate feature contracts or versions rather than silently letting one consumer’s optimization change the other’s meaning. During an online-store outage, each model should have an explicit fallback: cached values, a simpler model, or a rejected request when no safe result exists.

Practice the follow-up

Self-review

Give a timeline where an event-time-correct training join still includes a value the online model could not have seen.

Connect this to feature contracts.

Sources & further reading

Feast: point-in-time joins. The interview scenario, calculations, and proposed design choices are illustrative.

Continue your preparation

Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.