MLOps & Production MLAdvanced19 min read5 questions

Model Deployment: Serving Patterns, Feature Stores & Rollouts

The gap between a notebook and a service. Serving patterns, the feature-store problem they solve, and how to ship a model without breaking production.

Covers: Batch vs online vs streaming, training/serving skew, feature stores, shadow and canary deploys, rollback

The single most common reason a good model fails in production is not the model — it is the seam between training and serving. Different code paths, different data freshness, different feature definitions. Interviewers for ML engineering roles probe this hard because it is where the real work is.

Filter
0/5 mastered
IntermediateservingarchitecturelatencyAsked at Amazon, Uber

30-second answer

Batch precomputes predictions on a schedule and serves them from a key-value store — cheapest and simplest, but predictions are stale and you can only score entities you know about. Online computes on request — fresh and works for unseen inputs, but you must meet a latency SLA and have every feature available at request time. Streaming sits between: predictions update on events. Choose by how quickly the input changes and how tight the latency budget is.

Advancedtraining-serving-skewfeature-storeproductionAsked at Uber, Airbnb

30-second answer

Skew is any difference between how a feature is computed in training and at inference: different code, different data sources, different time windows, or different handling of missing values. The structural fixes are a single shared feature-transformation library used by both paths, a feature store with point-in-time correct training data and identical online serving, and continuous monitoring that re-scores logged serving features offline and compares distributions.

AdvanceddeploymentcanaryshadowAsked at Netflix, Stripe

30-second answer

Shadow first: run the new model on real traffic without serving its output, and compare score distributions and latency against the incumbent. Then canary a small percentage with automated guardrail monitoring, ramp progressively, and keep the old version warm for instant rollback. Ship the model behind a flag so the rollback is a config change, not a redeploy.

Advancedtestingci-cdqualityAsked at Google, Stripe

30-second answer

Regular software has deterministic expected outputs; ML code has statistical ones. So you test at four levels: data tests (schema, ranges, null rates, distribution), code tests (deterministic unit tests on transformations, shape and dtype assertions), model tests (behavioural — invariance, directional expectation, minimum functionality — plus performance thresholds on a frozen set), and infrastructure tests (serialisation round-trip, latency, training/serving parity).

Intermediatereproducibilityexperiment-trackingversioningAsked at Databricks, regulated fintech

30-second answer

Five things must be versioned together: code (git SHA), data (a snapshot or immutable query with a timestamp), environment (pinned dependencies and a container digest), configuration (all hyperparameters and feature definitions), and random seeds. Experiment tracking should record all five automatically at training time, plus the resulting metrics and artefacts, because nobody reconstructs this retrospectively.

Showing 5 of 5 questions for ml-deployment-and-serving-patterns.

Check your understanding

5 questions · no sign-up, nothing stored

0/5 answered
Question 1

1.With a 200 ms p99 latency budget, feature fetching takes 40 ms and other overhead 55 ms. Your model has:

Question 2

2.The single most effective practice for detecting training/serving skew is:

Question 3

3.Shadow deployment is valuable primarily because it:

Question 4

4.A directional expectation test asserts that:

Question 5

5.The hardest artefact to version for reproducibility is usually:

Hands-on challenge

Build it — this is what you talk about in a deep-dive round.

Ship a model with a real deployment pipeline

Take any trained model and build the surrounding machinery a production team would require.

Requirements

  • A shared feature-transformation module used by both training and a FastAPI serving endpoint, with a schema signature check.
  • Data contracts that fail the pipeline on violation, including a PSI drift check against a reference.
  • A behavioural test suite: invariance, directional expectation, minimum functionality and per-segment regression.
  • Automatic provenance capture (git SHA, data as-of, environment, config, seeds) logged with every run.

Stretch goals

  • Implement shadow mode: score both models per request, log both, and produce the comparison report.
  • Add canary guardrails with automatic rollback and demonstrate a triggered rollback.