Stop the Scraper Flood – mid-level system design challenge

A scraper is about to hit your public API with 10× normal traffic. Keep real users' requests fast while the flood lasts, and be healthy again the moment it stops.

Requirements

Goal

Hold p99 latency under 200ms, error rate under 0.5% through every stage of the test plan, then compare your design with a reference design.

The test plan

  1. Normal: 2,000 requests per second.
  2. Scraper flood: 20,000 requests per second.
  3. Flood over: 2,000 requests per second.

Hint

You can't out-scale a flood you don't control, and you shouldn't try. Put an API Gateway in front with a rate limit a little above normal traffic: excess requests get an instant HTTP 429 instead of queueing behind real users. Leave the servers behind the limit some headroom.

Solve it on the live simulator, free and in your browser.

More system design challenges