KatInterview

Triaging a CPU Saturation Incident on a Customer-Facing API

System DesignModel answer
MediumModel answerSystem Designincident-responsetroubleshootingprofiling

Last updated

Talk through how you would scope, diagnose, mitigate and follow up when a revenue-critical public API suddenly runs near 100% CPU, and justify your choice among rollback, scaling, throttling and queues.

You are on call for a public-facing API. An alert shows that CPU is running very high across the service. You are not given the full picture up front. You may ask for any information a normal production environment provides: service and host dashboards, logs, deployment and configuration history, and the ability to profile a live instance.

Every call to this API is tied to revenue and to customer trust, so turning traffic away is expensive.

Describe how you would handle the incident from start to finish.

1. Confirm and scope. What do you check in the first minutes? How do you decide how urgent this is, and who do you inform?

2. Find the cause. Describe an investigation that branches based on what you learn, not a fixed checklist. Explain how each answer changes your next question.

3. Mitigate. Pick a mitigation and defend it. Compare:

  • rolling back a change
  • scaling out
  • rate limiting customers (targeted or broad)
  • moving some work to an asynchronous queue

Explain how you would protect downstream dependencies and avoid a retry storm.

4. Follow up. What do you do once the service is stable?

Questions you may want to ask the interviewer: Is CPU high everywhere or only on some instances? Are latency and error rates affected? Did anything change recently? Has traffic changed, and is it concentrated on a few customers or endpoints? Is the service stateless and autoscaled?

Hints

Hint 1

Start with customer impact (latency, errors, saturation of the request path), not with the CPU number itself. High CPU with healthy latency is a very different situation from high CPU with timeouts.

Hint 2

The central fork is: did the work per request go up, or did the number of requests go up? Compare CPU per request, request rate, and a deploy/config timeline against the onset of the problem.

Hint 3

Prefer the least harmful mitigation that addresses the cause: rollback for a bad change, scaling for genuine load, narrow throttling for one abusive source. Broad rate limiting is the last resort when every call is revenue, and any rejection should tell clients how to back off.