CI/CD & Deployment interview question · Most asked
Compare rolling, blue-green and canary deployments.
Summary
Rolling deployments replace instances gradually; blue-green deploys a full new environment and switches traffic at once (instant rollback by switching back); canary releases send a small percentage of traffic to the new version, watch metrics, then ramp up.
Longer Answer
All require backward-compatible changes because old and new versions run simultaneously (rolling, canary) or the database is shared (blue-green).
Key Points
- Rolling: gradual replacement
- Blue-green: switch environments
- Canary: small % first
- Backward compatibility required
Comparison / Tradeoffs
| Strategy | Rollback speed | Extra capacity | Risk exposure |
|---|---|---|---|
| Rolling | Medium | Low | Grows during rollout |
| Blue-green | Instant | 2× during switch | All users at switch |
| Canary | Fast | Small | Small % first |
More most-asked CI/CD & Deployment questions
- What's the difference between continuous integration, continuous delivery and continuous deployment?
- What stages does a typical CI/CD pipeline contain?
- How do you run database migrations without downtime?
- What are best practices for writing Dockerfiles?
- What's the difference between liveness and readiness probes?
- How should secrets be handled in CI/CD pipelines?