Users report intermittent 5xx errors and slow responses on a production app behind an ALB, on ECS, talking to RDS. How do you diagnose it?
What they are really testing: Whether you debug a real AWS stack methodically with the right signals (ALB vs target 5xx, target health, RDS metrics, X-Ray), instead of guessing or restarting.
A real interview question
Users report intermittent 5xx errors and slow responses on a production app behind an ALB, on ECS, talking to RDS. How do you diagnose it?
What most people say
drag me
“I would restart the ECS tasks and scale up the service to handle the load.”
It acts before diagnosing. Restarting and scaling might mask a flapping health check or a database bottleneck temporarily, but without finding whether it is the LB, the app, or RDS, it will recur.
The follow-ups they ask next
What does the difference between ELB 5xx and Target 5xx tell you?
Target 5xx = the application returned the error (app bug, dependency failure). ELB 5xx (502/503/504) = the LB had no healthy target or the target timed out, an infrastructure/health/capacity problem. They send you to different places.
The app gets slow only under load and RDS connections are maxed. What is happening?
Connection pool exhaustion: too many app/task instances each opening connections, or no pooling. Add RDS Proxy to pool/reuse connections, right-size the pool, and check for slow queries holding connections.
What the interviewer is listening for
- Splits ELB vs Target 5xx first
- Checks target health/flapping + task limits
- Uses X-Ray + RDS connection/slow-query metrics
- Correlates with deploys/spikes
What sinks the answer
- Restarts/scales before diagnosing
- Cannot interpret 5xx source
- Never inspects RDS connections/queries
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.
“Localize before acting. [Split ELB 5xx (LB has no healthy target/timeouts) from Target 5xx (app returned it)]. Check [target health/flapping and ECS CPU/mem limits]. Walk [latency per hop with X-Ray, ALB to ECS to RDS]. Inspect [RDS connections + slow queries, the usual culprit]. [Correlate with deploys/spikes], then fix the actual layer, not a blind restart.”
Keep going with aws
Foundation
What are the EC2 purchasing options (On-Demand, Reserved, Savings Plans, Spot), and how do you mix them?
Foundation
Walk me through the main S3 storage classes and how you would use lifecycle policies to control cost.
Junior
How does AWS decide whether an IAM request is allowed? Explain the evaluation logic.
Junior
How does an EC2 Auto Scaling Group work, and how would you configure it to scale on load?
Mid
How do you choose between SQS, SNS, EventBridge, and Kinesis?
Mid
What are VPC endpoints, and when would you use a gateway endpoint versus an interface endpoint?
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