Design a Web Crawler
How the interviewer asks it
“Design a crawler that fetches and indexes billions of pages politely and without getting stuck in loops.”
Want the full answer? Watch lesson 10 of the free system design course: a 22-minute video walkthrough of this question.
Typed drills are free and unlimited: the AI scores your answer against the outline below.
What the interviewer is looking for
- A URL frontier with priority queues and per-host queues for politeness.
- robots.txt handling and a per-host delay.
- URL normalisation and a seen-set (often a Bloom filter) to avoid refetching.
- Content fingerprinting to skip duplicate pages.
- Trap defences: depth limits, URL length limits, per-site budgets.
How to structure your answer
- 01
Requirements
Scale (billions of pages a month), freshness, politeness, robustness to bad HTML and traps.
- 02
Estimates
Pages per second, average page size and storage per month.
- 03
Frontier
Front queues by priority, back queues by host, each host mapped to one worker so its delay is respected.
- 04
Fetch and parse
DNS cache, fetchers with timeouts, parsers that extract links and content.
- 05
Deduplication
Normalise URLs, check a Bloom filter of seen URLs, and hash content to skip mirrors.
- 06
Storage and recrawl
Raw pages in object storage, metadata in a key-value store, recrawl schedule based on how often each page changes.
Best answers from candidates
No candidate answers yet. Type yours, and if it scores 6 or more you can show it here without your name.
Answers are shared by candidates, without names, after a privacy check. Add yours
Common mistakes
- One global queue that hammers a single site.
- Ignoring robots.txt.
- No defence against infinite calendars and session-id URLs.
Follow-up questions to expect
- Crawl only pages that changed since the last visit.
- Render JavaScript-heavy sites.
Now answer it out loud
Max will ask you this exact question, listen to your answer, push on the weak spots with follow-ups like the ones above, and score you when you finish.
Practice with MaxFree: a 5-minute voice round and unlimited typed drills, with scored feedback. No card, and your camera is never recorded.
More system design interview questions
Preparing for this round? Read how to practice for a system design interview.