KatInterview

Building a Large-Scale Internet Page Fetcher

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsscalabilityfault-tolerance

Last updated

Design an architecture to retrieve and store billions of web pages while respecting site policies and handling failures gracefully.

You need to architect a system that downloads web pages at internet scale. The system should handle billions of pages, coordinate work across many machines, and behave responsibly toward the sites it visits.

What the System Must Do

Your design should address:

  1. Managing the work queue: How do you decide which pages to fetch next and in what order?
  2. Retrieving content: How do workers actually download pages?
  3. Respecting websites: How do you avoid overwhelming any single site with too many requests?
  4. Avoiding redundant work: How do you prevent fetching the same page or content multiple times?

Constraints and Goals

  • Scale: The system should support thousands of worker machines operating concurrently
  • Resilience: If a worker fails mid-download, that work should not be lost forever
  • Refresh strategy: Important or frequently-changing pages should be revisited more often than static ones

What to Provide

  • An architecture showing the major components and how they interact
  • Your approach to preventing multiple workers from hitting the same domain simultaneously
  • A data schema showing how you track which pages are pending, in-progress, or complete
  • Your strategy for detecting duplicate URLs and content across billions of entries

Hints

Hint 1

Think about how to partition work so politeness becomes a local problem rather than requiring global coordination

Hint 2

Consider what happens when a worker crashes halfway through downloading a page - how does the system know to retry?

Hint 3

Bloom filters can help with deduplication, but remember they have false positives