If you discover a critical bug shortly after deployment, what processes do you have in place to roll back the changes quickly and safely?

A rollback process reverts a production deployment to the last known-good version quickly and safely when a critical bug surfaces, minimizing user impact while a proper fix is developed.

Key Points

Example

If a Kubernetes deployment introduces a critical bug, kubectl rollout undo reverts the deployment to the previous ReplicaSet within seconds, restoring the last stable version while the team investigates the root cause offline.

# Kubernetes: go back to the previous version in seconds
kubectl rollout undo deployment/checkout-service
kubectl rollout status deployment/checkout-service

# Or to a specific earlier revision
kubectl rollout history deployment/checkout-service
kubectl rollout undo deployment/checkout-service --to-revision=12

// Even faster: hide the new code behind a feature flag and switch it off
@Value("${features.new-checkout:false}")
boolean newCheckout;

public Receipt checkout(Cart cart) {
    return newCheckout ? newFlow.checkout(cart) : legacyFlow.checkout(cart);
}

Interview Tip

A concise interview answer is

I'd rely on the deployment tooling's built-in rollback -- whether that's kubectl rollout undo, redeploying the previous artifact from the repository, or flipping back to the blue environment in a blue-green setup. Monitoring and alerting are what trigger that decision fast, and I'd make sure database migrations are backward-compatible so a rollback doesn't break on schema mismatches.

Last updated: 1 November 2026

Previous question: How do you verify your changes after they are deployed to production?

Next question: Where do you store your build artifacts?

More Spring Boot - Level V (Expert) interview questions

All Spring Boot - Level V (Expert) questions