A deploy went bad in production. How do you handle rollback, and how do you make rollback easy?
What they are really testing: Whether you prefer rolling back to a known-good version over risky forward-fixes under pressure, and know that immutable artifacts and backward-compatible DB changes make rollback safe.
A real interview question
A deploy went bad in production. How do you handle rollback, and how do you make rollback easy?
What most people say
drag me
“I would push a hotfix to production to fix the problem.”
Forward-fixing live under incident pressure is risky and slow, you are coding against a fire. The safer move is to roll back to the last known-good version first to restore service, then fix calmly. Rollback should be the reflex.
The follow-ups they ask next
Why are database changes the hard part of rollback?
Code is easy to revert (redeploy old artifact); schema changes are not easily un-migrated and data may already depend on them. Use backward-compatible (expand/contract) migrations so old code still works against the new schema, letting you roll back code independently.
When is forward-fixing actually the right call over rollback?
When rollback is impossible or worse, e.g. the bad release already made an irreversible data change, or the issue is in a dependency, not your deploy. Otherwise roll back first to restore service, then fix.
What the interviewer is listening for
- Rolls back to known-good before forward-fixing
- Immutable artifacts make rollback trivial
- Backward-compatible DB changes + automated rollback
What sinks the answer
- Forward-fixes live under pressure
- No fast rollback path
- Ignores DB rollback complications
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.
“In an incident, [roll back to the last known-good version first to restore service, debug after, do not forward-fix live]. Rollback is easy because [you redeploy the prior immutable versioned artifact, no rebuild]. Handle the DB with [backward-compatible (expand/contract) migrations so old code works against the new schema]. And [automate rollback on failed health checks/canary], so it happens fast.”
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
What are feature flags, and how do they decouple deployment from release?
Mid
Compare blue-green and canary deployments. When would you reach for each?
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