Skip to content
Tech Interview Prep
Technical interview guide

Canary Releases & Rollback for Models

Rolling out a new model version safely: a small traffic slice first, with a fast path back to the previous version.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: Amazon SageMaker deployment guardrails, Argo Rollouts, KServe, Kubernetes, and NIST AI RMF guidance current 2026-09-04.

Overview

Curated: · Written: · Reviewed:

Canary Releases & Rollback for Models

In one line

Ship a model as one immutable bundle, expose a small sticky slice of real users, gate each ramp step on thresholds agreed before traffic moves, and keep the previous complete bundle deployable so rollback is a pointer swap. Reach for it when offline metrics cannot show serving behaviour, latency, or user response.

Key definitions

  • Release bundle: weights, tokenizer, transforms, feature definitions, runtime, lockfile and schema versions, shipped and rolled back as one unit.
  • Shadow (dark launch): the candidate scores mirrored traffic and its outputs never reach users. It tests parity and serving, not user response.
  • Sticky assignment: a stable user-level hash, so one user always sees one arm.
  • Detection floor: the smallest effect a sample can reliably see, given baseline rate and n. State it before reading "no regression".
  • Representative eligible traffic: real user requests that exercise the changed path. Synthetic health checks and elapsed time do not count.
  • Expand-and-contract: add new schema before anything removes old schema, so the old and new bundles both read the data.

Formulas and complexity

For a binomial metric with n requests and rate p, the expected count and its noise are:

μ=np,σ=np(1−p)\mu = np,\qquad \sigma = \sqrt{np(1-p)}

Worked example (hypothetical figures): 2,000 canary requests at a 4% baseline give μ = 80 and σ ≈ 8.8. A drop to 2% (μ = 40) is about 4.6σ and will show. A drop to 3.7% (μ = 74) is under one σ and will not. Run an A/A test on the same build to measure the real noise; a canary delta inside the A/A range is not evidence of regression.

How it works

  1. Shadow first when you doubt the plumbing; canary when you doubt the model.
  2. Assign each user to one bundle by sticky hash. Record assignment separately from successful exposure.
  3. At each step, compare candidate and baseline concurrently, per version: guardrails first (errors, p99, saturation), then quality proxies.
  4. Advance only after enough real eligible requests per arm. Otherwise hold, under a decision rule for the timeout.
  5. Roll back by pointing traffic at the previous bundle, then reconcile queues, caches and writes.
guardrail breach hold: too few real requests pass Release bundle vN+1 Shadow: mirrored traffic, outputs unused Canary 5 percent, sticky users Per-version gate Pointer swap to previous bundle Ramp to 25 then 100 percent Keep baseline through delayed-signal window Terminate baseline

When to use and when not to

SituationUseAvoid or add
Doubt serving, schema or feature parityShadow before any canaryA canary cannot show parity bugs safely
Need a causal product effectA/B with sticky assignmentCanary metrics are not causal
Rare failure or low trafficLonger bake, targeted cohortA short canary gives false assurance
Irreversible migration or backfillExpand-and-contract before the canaryRollback of the bundle cannot undo writes
Need a clean concurrent baselineBlue/green, at capacity costRolling mixes versions and makes rollback slow

Traps interviewers probe

  1. Comparing per-request randomized arms. Fix: sticky user-level assignment. Per-request splits let one user see both arms and blend populations.
  2. Reading a blended fleet p99 as a candidate verdict. Fix: alarm per version. A fleet p99 near 400 ms can come from about 1% of requests in the tail, all from one version.
  3. Baking on clock time or synthetic traffic. Fix: count real eligible requests per arm (for example 10,000 before reading error rates) and extend the bake until you have them.
  4. Treating missing telemetry as a pass. Fix: a fallback source with different counts and definitions is not equal evidence. Hold the verdict and repair the source.
  5. Rolling back only the weights. Fix: restore the complete previous bundle, and make migrations additive so the old bundle still reads the data.

Interview tips

Open with the decision, not the vocabulary: "I would shadow to check parity, then canary the full bundle at 5% with sticky assignment, gated on guardrails I fix before traffic moves, with the previous bundle kept deployable."

Follow-ups to expect:

  • "The canary is clean after 24 hours. Promote?" State the detection floor first. Say what the canary rules out (errors, tail latency, schema) and what it cannot (small quality effects). Defer final quality judgement until labels arrive.
  • "Latency worsened but conversion improved." Guardrails fail the release regardless of quality gains. The rule was written in advance.
  • "We checked the test every morning." Repeated looks at alpha 0.05 inflate false positives. A p of 0.03 at an unplanned look is not a registered result.
  • "Exposed users are 45k in control and 38k in treatment." That gap is a sample ratio problem. Find where assignment and exposure diverge before comparing anyone.
  • "What if we roll back after writes?" Rollback stops new harm. Compensating work on records already written is the longer half of recovery.

30-second answer outline:

  1. Shadow for parity, then a 5% sticky canary of the complete bundle.
  2. Per-version guardrails, thresholds fixed in advance, and a minimum of real eligible requests per arm.
  3. Hold on missing telemetry. Never default to promote.
  4. Ramp in steps, then keep the baseline through the delayed-signal window.
  5. Roll back to the previous complete bundle, reconcile queues and writes, and compensate what was already served.

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.