Advanced·Scenario·2 min read

API latency jumps from 200ms to 5s. What do I do?

Practice this question

Short explanation:

A jump from 200ms to 5s indicates that requests are doing more work, waiting longer, or both. The first task is to establish scope and timing so the incident is not mistaken for one user's network issue. Then use measured stages to separate a recent regression from traffic or dependency saturation.

Key points:

  • Check affected routes, p95 latency, traffic and recent releases.

  • Trace slow requests to separate DB time, pool waits, CPU work and external calls.

  • Reduce impact with a safe rollback or load control, then fix and measure the cause.

  • Check whether latency rose on all requests or only a route, tenant, payload size or app version.

  • If a rollback is appropriate, verify schema compatibility and monitor errors as well as latency afterward.

Interview point:

  • Present investigation, immediate mitigation and long-term prevention as separate actions.
Adapted from 08_PERFORMANCE_SECURITY.md · “1. API latency jumps from 200ms to 5s. What do I do?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.