Traffic is expected to 10x for a sale next week. How do you prepare the platform?
IntermediateScenarioScaling and performance
Answer
Situation read → You know it's coming, so this is capacity planning plus load testing, not firefighting.
What I'd do →
- Get a number: expected peak RPS, and which flows (browse, checkout) carry it.
- Load test the whole path at 1.5x the expected peak with k6 or Locust against a prod-like environment. Find the first bottleneck; it's usually the database, not the pods.
- Pre-scale: raise HPA
minReplicas, raise node group minimums or Karpenter limits, and pre-warm anything that scales slowly (ALBs can be pre-warmed via AWS support, RDS read replicas take time to create). - Check quotas: EC2 vCPU limits, Lambda concurrency, IP addresses in subnets, NAT gateway throughput.
- Freeze risky changes, prepare runbooks for degradation (disable recommendations, queue orders), and put the right people on call.
Why → Autoscaling reacts in minutes; a flash sale spikes in seconds. Pre-scaling covers the gap.
Interview tip → Mention service quotas and subnet IP exhaustion; most candidates forget them.
More on Scaling and performance
The 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?AdvancedOne pod in a deployment is much slower than the others. How do you investigate?Beginner