All problems

Web Crawler

Crawl billions of pages — fast, polite, and without repeating yourself.

medium~22 min Pro Simulator · +110 ptsTheory +36 pts
The build

Crawl the web at high throughput — politely and without re-fetching the same pages — as fetchers crash and the page store stalls.

Discovery and fetching are decoupled by a URL frontier (priority + per-host politeness). Dedup URLs and content so you don't waste bandwidth, and cache DNS so the resolver isn't the bottleneck.

Components in play

  • URL frontierPriority + per-host politeness queues of URLs to crawl.
  • FetchersAsync workers that download and parse pages.
  • DNS + seen-URLCaches DNS and the visited-URL set (bloom filter).
  • Page storeRaw fetched pages in object storage.

Graded on these SLOs

  • ≥ 6.0k rpsCrawl rate
  • ≥ 97.00%Fetches succeed
  • ≤ 90%Headroom
  • ≤ 9Lean fleet
Base 6,000 rps35s run 3 scripted failures

The brief

Design a web crawler like Googlebot: start from seed URLs, download pages, extract links, and feed new URLs back in. The hard parts are throughput (billions of pages), politeness (don't hammer one host), and not re-crawling the same content forever.

Functional

  • Fetch pages starting from seed URLs
  • Extract links and enqueue new URLs
  • Deduplicate URLs and page content

Non-functional

  • High, sustained fetch throughput
  • Politeness — rate-limit per host, respect robots.txt
  • Don't re-fetch or re-store duplicates

Read the deep dive

16 min read

A web crawler looks deceptively trivial. Download a page, pull out its links, download those, repeat. You could write the core loop in ten lines. The trap is that the naive loop fails on every axis that matters at scale: it has no throughput ceiling you can reason about, no manners (it will hammer a single host until you are firewalled or sued), and no memory (it re-downloads the same pages forever, burning bandwidth on content it already has). The interesting engineering is entirely in the parts the ten-line version skips. This guide builds the design the way you would in an interview, and it lines up with the SysGym web-crawler simulator so the two reinforce each other. The gym hands you seed URLs at 6,000 pages per second, then ramps offered load to 1.5x and finally 2x as extracted links feed back in (a deep crawl peaking at 12,000 pages/sec). While that happens it crashes a fetcher, stalls the page store, and slows the DNS resolver. You have to keep at least 97 percent of fetches succeeding, keep the busiest component under 90 percent utilization, and do it with a lean fleet. Everything below is in service of arriving at a design that clears those targets on purpose rather than by luck.

Warm-up: design decisions

Optional theory to prime the calls a senior engineer would make before you build.

Pro

Solving is a Pro feature

Unlock the on-canvas AI design coach, per-run design reviews, the chaos simulator and all 12 problems for $15/month.

  • AI design coach on your canvas — pins failure points & over-engineering
  • Honest AI design review on every run
  • All 12 problems + unlimited chaos simulator
  • Points, levels & leaderboard
Get started