Skip to content
Tech Interview Prep
Technical interview guide

Deployment Strategies (Blue-Green, Canary, Rolling)

Different ways to roll a new version out safely, trading off speed, blast radius, and infrastructure cost.

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

Scope: Kubernetes, Argo Rollouts, Istio, Flagger, Amazon ECS, OpenFeature, DORA, Google SRE, and NIST guidance current 2026-08-31.

Overview

Curated: · Written: · Reviewed:

Deployment Strategies (Blue-Green, Canary, Rolling)

In one line

Strategies that control how a verified release reaches production, trading delivery speed and infrastructure cost against blast radius and rollback speed. Use rolling for stateless services with tight capacity, blue-green when cutover and rollback must be instant and auditable and you can pay for double capacity, and canary when you need evidence from live traffic before full exposure.

Key definitions

  • Blast radius: the share of users or requests exposed to a bad release before it is detected or reverted.
  • maxSurge: extra pods allowed above the desired replica count during a rollout. Percentages round up.
  • maxUnavailable: pods allowed below the desired count during a rollout. Percentages round down.
  • Expand-contract: a three-step schema change (expand, migrate, contract) so old and new code can run against the same data.
  • Canary cohort: the population routed to the new version, chosen by stable sampling, tenant or region.
  • Guardrail: a predeclared metric, threshold and minimum sample size that gates each promotion step.

Formulas and complexity

surge=⌈0.25×6⌉=2,unavailable=⌊0.25×6⌋=1\text{surge} = \lceil 0.25 \times 6 \rceil = 2, \quad \text{unavailable} = \lfloor 0.25 \times 6 \rfloor = 1

So 6 replicas at 25%/25% allow at most 8 pods and require at least 5 ready.

2×8×pool≤280  ⇒  pool≤172 \times 8 \times \text{pool} \le 280 \;\Rightarrow\; \text{pool} \le 17

Both fleets at 8 instances with a 280-connection budget: 17 per instance (17.5 rounded down). Labelled worked example. Double capacity: blue-green and full canary each need about 2×2\times capacity during the window; rolling needs only the surge.

How it works

  • Rolling: new pods start within the surge allowance, and old pods are removed only as replacements report Ready. Old and new versions serve together for the whole rollout.
  • Blue-green: green is built and validated while blue serves. The load balancer pointer flips, and blue stays warm so rollback is another flip.
  • Canary: traffic weight moves through steps (1%, 5%, 25%, 100%) with a dwell time per step. Each step compares the canary to a concurrent baseline. Abort reverts the weight.
Rolling Blue-green Canary No Yes Verified artifact Strategy Replace pods within maxSurge and maxUnavailable Validate green then flip pointer Step weight 1 to 5 to 25 to 100 percent Guardrails pass at this step? Revert weight

When to use and when not to

FactorRollingBlue-greenCanary
Extra capacitySurge onlyAbout 2x during windowAbout 2x at full canary
RollbackReverse roll, proportional to rollout timePointer flip, secondsWeight revert, fast
Mixed versionsWhole rolloutBrief at cutover, old fleet kept warmWhole canary window, by design
Choose whenStateless, tight capacity, small blast radiusAuditable instant cutover, double capacity affordableHigh traffic, fast metrics, evidence before exposure
Avoid whenInstant rollback needed, no compatibility guaranteeCannot double capacity, singleton background workLow traffic cannot reach sample size, metrics lag hours

Traps interviewers probe

  1. Assuming zero-surge rollouts keep capacity. With maxSurge 0 the controller removes pods before replacements exist, so survivors absorb the load and latency climbs with no NotReady pods and no errors. Fix: allow surge, or cap maxUnavailable so the remaining pods stay under their saturation point at peak.
  2. Believing a PodDisruptionBudget governs a rolling update. A PDB limits voluntary evictions. Rollout limits come from maxSurge and maxUnavailable. With 10 replicas and maxUnavailable 2, Ready pods can drop to 8 even with minAvailable 9. Fix: set the rollout parameters to the floor you need.
  3. Bundling a destructive migration with the release. Old code still reads the dropped column, so the traffic rollback routes it into an incompatible schema. Fix: expand-contract, with the contract step as a separate, gated deployment.
  4. Promoting on a global average. A healthy aggregate can hide one tenant, region or endpoint burning. Fix: check per-cohort slices against the baseline, and treat too few samples as a failed measurement, not a pass.
  5. Trusting the configured weight. Retries, async workers and batch jobs shift the real exposure. Check: 10% of requests at 48 ms against 90% at 12 ms gives 4.8 / (4.8 + 10.8), about 31% of handler CPU. Fix: verify achieved share per version from request counts and CPU.

Interview tips

Open by naming the strategy, stating the four axes (speed, blast radius, cost, rollback speed), then the hard constraint: schema compatibility and how abort works. Do not pick a favorite without the workload's properties.

Follow-ups to expect:

  • Canary or blue-green? Answer with detection speed, double-infra cost and state compatibility.
  • How do you roll back a canary that already wrote new-format data? Weight revert plus reconciliation, because expand-contract keeps old readers working.
  • Minimum cohort and dwell time? Give figures from metric latency and sample-size math, labelled as hypothetical if needed.
  • What breaks that is not the new code? Capacity during surge, connection draining, background jobs, caches, external callbacks.

30-second outline: I would use [strategy] because [workload property]. Expose 1%, then 5%, 25%, 100%, gating each step on error and latency against a concurrent baseline with a minimum sample size. The schema is expand-contract so both versions run. Abort is a weight revert, a write pause and reconciliation. I would verify the achieved weight and check background jobs and caches during the rollout.

Feedback on this overview

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