Evals & Observability·Question 32 of 83Intermediate

You are swapping the model behind a live feature. Walk me through shadow, canary and A/B. When do you use each?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

They are a sequence with increasing user exposure and increasing quality of evidence, and they answer different questions. Offline evals come first; these three are what you do after.

Full worked answer with diagram

They are a sequence with increasing user exposure and increasing quality of evidence, and they answer different questions. Offline evals come first; these three are what you do after.

Shadow: mirror production traffic to the candidate, serve the incumbent's response to the user, score the candidate offline. It answers "does the candidate behave sanely on the real input distribution", which your eval set cannot tell you because your eval set is not your traffic. It catches crashes, format breaks, refusals, latency regressions and cost blowouts on real inputs, at zero user risk. Costs: you pay double inference, and there is one sharp edge people miss. If the feature has side effects, shadowing an agent means it actually issues the refunds and sends the emails twice. You need read-only mode or mocked write tools before you shadow anything agentic.

What shadow cannot tell you is whether users like it, because no user saw it.

Canary: serve the candidate to a small slice, ~1-5%, with guardrails wired to auto-rollback on error rate, latency, cost and safety violations. It answers "does this survive contact with users", and it is about blast radius, not statistics. A canary at 2% will almost never have the power to resolve a 2-point quality difference.

A/B: user-level randomisation, powered, run for one to two weeks against a north-star product metric plus guardrails. This is the only one that answers "is this better for users", and the only one that sees novelty effects and longer-horizon behaviour like retention and escalation rates.

Not every change earns all four stages. A prompt typo fix goes offline eval then ship. A model family swap gets the full ladder, because that is where behaviour shifts in ways your eval set has never seen.

Worth sketching. Writing the question each stage answers under each box is what stops the three from sounding interchangeable.

flowchart LR
    O["Offline evals"] --> S["Shadow: mirror traffic,<br/>nobody sees the output"]
    S --> C["Canary: 1-5% of users,<br/>auto-rollback on guardrails"]
    C --> A["A/B: user-randomised,<br/>1-2 weeks, powered"]
    S -.-> Q1["Sane on the real<br/>input distribution?"]
    C -.-> Q2["Survives contact?<br/>Blast radius, not statistics"]
    A -.-> Q3["Actually better<br/>for users?"]

What a good answer covers

  • They are a sequence with increasing user exposure and increasing quality of evidence, and they answer…
  • Offline evals come first; these three are what you do after
  • It catches crashes, format breaks, refusals, latency regressions and cost blowouts on real inputs, at…
  • Costs: you pay double inference, and there is one sharp edge people miss
  • If the feature has side effects, shadowing an agent means it actually issues the refunds and sends the…

Interviewer follow-ups to expect

  1. How would you shadow an agent that writes to a production database?

  2. Your canary looks fine at 2% and quality tanks at 50%. What happened?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep