Compare blue-green and canary deployments. When would you reach for each?
What they are really testing: Whether you can reason about deploy strategies as risk-versus-cost trade-offs, not just name them. They want you to tie each to blast radius, rollback speed, and the cost of running parallel capacity.
A real interview question
Compare blue-green and canary deployments. When would you reach for each?
What most people say
drag me
“Blue-green is two environments and canary is a gradual rollout, so I would use whichever the team already uses.”
It defines the terms but ducks the actual question, the trade-off. No mention of blast radius, rollback speed, cost of parallel capacity, or the observability canary depends on. Deferring to "whatever the team uses" signals no independent judgment.
The follow-ups they ask next
Your canary slice looks fine but the issue only appears at full load. How do you reduce that risk?
Route enough traffic and run long enough to be representative; weight the canary toward realistic load and include the slowest/heaviest cases. Pair it with load testing pre-release, and gate the ramp on SLO/error-budget burn, not just a quick glance at a dashboard.
A deploy includes a DB migration that drops a column. Why does that complicate both strategies, and what do you do?
Old and new run simultaneously, so a destructive migration breaks the old version still serving traffic. Use an expand/contract (parallel-change) migration: add the new shape, deploy code that works with both, migrate data, then remove the old column in a later release.
What the interviewer is listening for
- Frames it as a risk-vs-cost trade-off
- Names blast radius and rollback speed explicitly
- Calls out the parallel-capacity cost of blue-green
- Knows both require backward-compatible migrations
What sinks the answer
- Only defines the terms without the trade-off
- Ignores the cost of double capacity
- Forgets canary needs good observability
- No awareness of the migration compatibility problem
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“Blue-green is [a full second environment with an all-at-once switch], giving [instant rollback] but [double capacity cost]. Canary is [a small traffic slice that ramps], which [limits blast radius] but [needs good metrics]. I pick blue-green for [atomic cutover] and canary for [a risky change where I want to contain blast radius]. Both need [backward-compatible migrations].”
Keep going with deployment
Foundation
What do CI and CD actually mean, and what is the difference between continuous delivery and continuous deployment?
Foundation
Why should you build an artifact once and promote the same one through environments?
Junior
What stages should a good CI/CD pipeline have?
Junior
A deploy went bad in production. How do you handle rollback, and how do you make rollback easy?
Junior
What are feature flags, and how do they decouple deployment from release?
Mid
How does your branching strategy affect continuous delivery? Trunk-based versus long-lived branches.
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free