Design an automated rollback process when deployment error rates spike
judgment when automating rollbacks.
gate on error-rate and latency thresholds; use blue-green deploys to limit blast radius; require human approval for stateful rollbacks.
instant full rollback from one noisy metric.
WHAT THIS TESTS: This question tests whether you can design a safe automated remediation system rather than just a deployment conveyor belt. Interviewers want to see that you understand the difference between a deployment pipeline and a resilience strategy. They are looking for signal interpretation, blast-radius containment, and stateful versus stateless reasoning. The core theme is operational rigor: automating recovery without automating chaos.
A GOOD ANSWER COVERS: A strong answer walks through four layers in order. First, detection logic: use a composite health signal rather than a single metric. Combine HTTP 5xx rate, p99 latency, and a custom business metric such as checkout conversion drop, evaluated over a 2 to 5 minute window to avoid flapping. Second, traffic isolation: implement blue-green deployments or canary releases so only a small percentage of traffic hits the new version initially. If the composite signal breaches a threshold, halt promotion and drain traffic back to the stable fleet. Third, rollback scope: fully automate rollback for stateless microservices, but require a manual approval gate for any change involving database schema migrations, cache invalidation, or cross-region replication, because backward-incompatible data changes can turn a bad deploy into a data-loss incident. Fourth, post-rollback verification: after shifting traffic, confirm that error rates return to baseline and that the previous artifact is still healthy, rather than assuming old code is automatically good.
COMMON WRONG ANSWERS: The biggest red flag is proposing an immediate 100 percent rollback triggered by a single alert. This ignores the possibility that the spike is caused by a downstream dependency or an upstream traffic spike, not the new build. Another red flag is forgetting data-layer risk: saying you would automatically roll back a schema migration without a compatibility plan can corrupt production data. A third pitfall is neglecting the warm-pool requirement; if the old version has been scaled down or its containers evicted, the rollback itself becomes a new deployment with its own cold-start failures.
LIKELY FOLLOW-UPS: The interviewer may ask how you would handle a rollback that itself fails, such as when the previous artifact will not start because its database schema is now newer than what it expects. They may also ask how to prevent rollback loops where a bad build deploys, rolls back, and then the next commit triggers the same cycle. A third follow-up is cost: how do you justify running a blue-green fleet at 2x capacity for the sake of safer rollbacks.
ONE CONCRETE EXAMPLE: In an AWS CodePipeline setup, you can model this with a CodeDeploy blue-green deployment to an ECS service. The pipeline deploys a new task definition, shifts 10 percent of traffic via an Application Load Balancer target group, and runs a CloudWatch alarm on 5xx rate and latency for 3 minutes. If the alarm fires, CodeDeploy automatically reroutes traffic to the original task set and terminates the new tasks. For the database layer, you place a manual approval gate before any schema change step in the pipeline, ensuring the DBA team reviews backward compatibility before the deploy proceeds.
Read the original → docs.aws.amazon.com
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.