Interview Question
How would you protect an API from a sudden 20× traffic spike while keeping legitimate users served?
What the interviewer is testing
- Capacity planning
- Fairness
- Graceful degradation
Real-World Sample Answer
I would approach “How would you protect an API from a sudden 20× traffic spike while keeping legitimate users served?” by clarifying the requirements first, then using these considerations: in a real interview, i would not jump straight to a technology choice. for “how would you protect an api from a sudden 20× traffic spike while keeping legitimate users served?”, i would first identify the actual bottleneck and capacity envelope. then i would use rate limiting or quotas to protect dependencies and scale stateless layers where useful. i would also cache or shed non-critical work. finally, i would monitor saturation and recovery. i would make the assumptions explicit and explain what evidence or production signals would make me revisit the decision.. I would state my assumptions and defend the trade-offs rather than presenting the choice as universally correct.
What a Strong Answer Should Cover
In a real interview, I would not jump straight to a technology choice. For “How would you protect an API from a sudden 20× traffic spike while keeping legitimate users served?”, I would first identify the actual bottleneck and capacity envelope. Then I would use rate limiting or quotas to protect dependencies and scale stateless layers where useful. I would also cache or shed non-critical work. Finally, I would monitor saturation and recovery. I would make the assumptions explicit and explain what evidence or production signals would make me revisit the decision.
Common Mistakes
- Autoscaling everything
- No protection for downstream dependencies
- No graceful degradation plan
Interviewer Follow-ups
- What assumptions would you clarify before committing to the design?
- What changes if the scale, reliability target, security requirement, or budget changes?
- What is the biggest failure mode in your proposed approach?
Related Learning
- Use the Interview Preparation learning paths and related site content to deepen any topic you could not confidently explain.