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
Normal traffic: 2,000 req/s
Scraper flood: 20,000 req/s for a while
p99 latency: ≤ 200 ms, even during the flood
Errors: ≤ 0.5% normally; rejected flood traffic is expected
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
Normal: 2,000 requests per second.
Scraper flood: 20,000 requests per second.
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.
Hello, Load Balancer - One API server is drowning under 1,500 RPS. Bring p99 latency to 500 ms or less and keep errors at 0.5% or less without touching the traffic.
Cache Money - Your database is at 95% utilization serving reads it has answered a thousand times. Cool it down below 50%.
Design a URL Shortener - Redirect traffic grows from 1,000 to 20,000 requests per second. Keep every redirect fast through a cache restart and a server failure at peak, within budget.
Checkout failures on sale morning - An on-call drill. Checkouts started failing minutes after a sale opened. Find the part that is failing, fix it with settings only, then answer one question about the fix.
The Stampede - Your cache will be flushed mid-run. Survive the stampede - keep errors under 5% while it refills.
Queue It Up - Write traffic spikes 5× partway through. Absorb the burst without dropping a single write.
Design a Chat System - Messages and history reads grow to 10,000 a second, then New Year's midnight triples it. Keep sends fast and every message delivered within 10 seconds, within budget.
Design a Notification System - Your app sends push notifications through a provider that accepts 2,000 a second. Breaking news is about to multiply events 20×. Deliver every notification within a minute without the provider rejecting any.
Design a News Feed - Timeline reads and new posts grow to 30,000 requests a second at peak. Keep timelines fast, get every post into followers' feeds and search within 10 seconds, within budget.
Design a RAG Pipeline - Your support assistant answers questions from the company's documents with an LLM. Usage grows from 5 to 30 questions a second. Keep answers grounded, under 4 seconds, and inside a $70,000 monthly model bill.
Design a RAG Ingestion Pipeline - An enterprise customer uploads 10,000 PDFs at once. Each one is parsed, split into chunks of about 300 tokens, embedded with Titan Text Embeddings V2 and written to a vector database. Bedrock throttles embedding models by requests a minute, and your quota for this one is 6,000, which AWS won't raise. Get every chunk embedded without losing any, and keep uploads fast.
Design IRCTC Tatkal Booking - At exactly 10:00 Tatkal booking opens and traffic jumps tenfold in a second. Keep the site up, accept every booking attempt, and confirm each one within a minute, within budget.
Hotstar: The Wicket Spike - It's the IPL final. Video comes from the CDN, but every app also calls your home-screen and scorecard API. When a big wicket falls, millions of viewers press back at once. Survive the toss and the wicket without a single wave of errors.
Design Food Delivery (Swiggy, Zomato) - Customers browse menus and order; riders send their location every few seconds. Traffic climbs to 30,000 requests a second on New Year's Eve. Keep menus fast and every rider on the map within 10 seconds, within budget.
Design the Flipkart Big Billion Days Sale - At noon a phone goes on sale at a price nobody can resist, and half of all traffic is for that one product. Keep product pages up and take orders without overselling, within budget.
Design UPI Payments - A UPI app on salary day: payments go through NPCI to the banks, which answer in about a second, and sometimes much slower. When they slow down, phones time out and retry. Make sure no one is debited twice.
Design a Flight Search Aggregator - Travellers search for flights and your service asks the airlines' partner APIs for fares, then returns the best options. A holiday sale pushes searches to 3,000 a second, and later the airline APIs slow down. Keep search fast, stay inside the airlines' rate limit, and keep the bill within budget.
Design a Distributed Job Scheduler - Teams submit jobs through an API and poll for their status, and recurring jobs fire on a timer. Each job calls the system it acts on and waits about a second for it to finish. At month end, team traffic jumps to six times a normal hour, and then the target systems slow to two seconds a job. Every job must start within 10 seconds of being submitted or falling due, and none may be lost, within budget.
Design a Tagging and Search System - People tag pages and issues across a large workspace product, and find work by searching for a tag. Tags are saved in a database and copied into a search cluster. On Monday morning traffic is six times a quiet day, and later one search node dies. Keep tag searches fast, make new tags searchable within 5 seconds, and stay within budget.
Design YouTube Uploads - Creators upload video in 16 MB chunks while viewers load video pages. Uploads grow fourfold on a festival evening. Keep pages fast and uploads flowing, within budget.
Design an Ad Click Aggregator - Every ad click is logged so advertisers can see clicks per ad per minute and be billed for them. Clicks climb to 12,000 a second during a big sale, while advertisers keep refreshing their dashboards. Count every click and keep dashboards fast, within budget.
Handle a Webhook Spike with Lambda - Your payment provider sends a webhook for every payment, and a Lambda function copies each one into your CRM. The CRM takes about a second to answer and accepts 500 calls a second. A flash sale is about to send 2,500 webhooks a second. Get every payment into the CRM within a minute, without dropping any.
Design Dropbox Sync - Every device a user signs in on keeps a folder in sync. Devices ask the server for changes every 10 seconds, upload changed files in 4 MB blocks, and list and edit files. On Monday at 9 am, 240,000 devices are online. Keep sync fast and every upload safe, within budget.
The Retry Storm - Your database is about to slow down by 400 ms. Your clients retry failures up to three times. Keep the API standing.
Black Friday - Traffic is 12,000 RPS and the CFO capped infra at $3,000/month. Keep p99 under 300ms and errors under 1%.
Chaos Monkey - A monkey will kill your busiest API server mid-run. Design for redundancy so users never notice.
The CTO Budget Cut - This system works - and burns about $15,000/month doing it. Hit the same SLOs for under $1,500/month.