SimuVedaSystem Design Lab Open in the lab

Design interviews / Intermediate / 6 min / Updated

Design a web crawler: frontier, politeness and traps

Workers fetch pages and queue links. Drop the seen-set and pages repeat, drop politeness and small sites get hammered, and a calendar trap never ends.

Start the simulation → Change the load, break a part, watch what happens. Free, no sign-up.

In short

How do you design a web crawler?

A crawler takes URLs from a frontier, fetches pages, extracts links and queues the new ones, with one queue per host.

Why does it matter?

Search engines and AI datasets need billions of pages, fetched without repeats and without overloading small sites.

What is the trade-off?

More workers help only until every host waits its turn; dedupe needs memory (Bloom filters); traps need limits.

How do you explain it in an interview?

"URL frontier with per-host queues and crawl-delay, Bloom-filter seen-set, depth and per-site caps, robots.txt, content hash dedupe."

Check yourself

What does the seen-set in a crawler prevent?

Answer: Fetching the same URL again and again. Pages link to each other heavily; without checking (often with a Bloom filter) most fetches become repeats.

Why is per-host politeness needed?

Answer: Many workers hitting one small site at once can overload it or get you blocked. Crawlers keep one queue per host and wait between fetches, honouring robots.txt crawl-delay.

How do you stop a crawler trap like an endless calendar?

Answer: A depth or per-site page limit, plus URL pattern rules. Trap pages keep generating new URLs; limits on depth and pages per site stop them eating the crawl.

See it happen in the simulation →

web crawlercrawlerurl frontierpolitenessrobots.txtcrawler trapbloom filtersystem design interview

More in design interviews