Question presented to candidate:
"We need to build a crawler that downloads about a billion web pages a month for a search index. Walk me through the architecture. How do you stay polite to websites, avoid downloading the same thing twice, and not get stuck?"
What a strong answer should cover:
A worked capacity estimate: pages per second, bandwidth, storage per month, and the number of hosts that must be crawled in parallel because of per-host politeness
The pipeline: seeds, URL frontier, DNS resolution, fetchers, parser and link extractor, deduplication, content store, with the frontier as the central data structure
Politeness: one connection and a delay per host, robots.txt (standardised as RFC 9309; Crawl-delay is not part of it), and a frontier with priority queues in front and per-host queues behind, as in the Mercator design
Deduplication at two levels: normalised URLs (a seen set or Bloom filter) and page content (exact fingerprints, near-duplicate detection with SimHash)
Crawler traps, per-host budgets and depth limits; recrawl scheduling by change rate with conditional GETs; partitioning the frontier by host across machines
Clarifying questions expected:
What is the crawl for (search index, price monitoring, archive), and so which pages matter most?
How fresh must the data be: one pass, or continuous recrawling?
Do we need to render JavaScript, or is raw HTML enough?
Code / implementation expected: Optional β a URL frontier with per-host delays, robots rules and dedup; the example simulates exactly that, including a crawler trap.
system-design
case-study
2
Try it yourself
Sketch your approach before you read the solution. That is what the interview tests.
Stuck? Get a hint.
A short nudge toward the approach. It will not give the answer away.
3
Solution
Target Audience: Engineers preparing for a system design round; no prior knowledge of crawling or search engines is assumed, and every term is defined when it first appears.
Difficulty: Hard
Verified with: Node 22.22 and Python 3.12 (both print identical output). The robots.txt standard (RFC 9309) and search engine handling of Crawl-delay checked against the RFC and Google Search Central in October 2026.
How to read this doc: Every idea is explained in plain language first, then tagged with π Interview term: so you also learn the exact words an interviewer expects. The capacity numbers and the crawl log come from the example program; the Verified section quotes its full output.
1. Why This Even Matters β A Story First
Imagine you are asked to photograph every shop window in a huge city, and to do it again every few weeks. You have a team of photographers
The solution is hidden so you can try first
15 min read Β· 15 sections
4
Read the code
Crawler frontier: per-host politeness, robots.txt, URL normalization, content dedup and a crawler trap