A batch job that used to take 1 hour now takes 6. Nothing in its code changed. What do you check?
IntermediateScenarioScaling and performance
Answer
Situation read → If the code didn't change, the input, the environment or the dependencies did.
What I'd do →
- Data volume: did the input grow (table size, files to process)?
- Database: table bloat, missing vacuum or stale statistics, an index dropped, lock contention with a new daytime workload.
- Infrastructure: instance type changed, Spot node interruptions restarting it, EBS volume out of gp2 burst credits, or a lower CPU limit.
- Network: now crossing AZs or going through a NAT gateway instead of a VPC endpoint to S3.
- Instrument the job's phases to see which one grew, then fix that phase.
kubectl get job nightly-etl -n batch -o yaml | grep -A5 resources
Why → gp2 burst credits and table bloat both cause gradual, "nothing changed" slowdowns.
Interview tip → Asking "what else changed?" methodically is the skill being tested.
More on Scaling and performance
Traffic is expected to 10x for a sale next week. How do you prepare the platform?IntermediateThe HPA is configured but pods don't scale even though the app is slow. Why?BeginnerPods are Pending during a traffic spike because the cluster is out of capacity. What do you do now and long term?IntermediateThe database CPU is at 95% and the API is timing out. What's your approach?Intermediate"Too many connections" errors from Postgres after scaling the app out. How do you fix it?IntermediateLatency is fine on average but p99 is terrible. Where do you look?Advanced