Design a web crawler (like Googlebot)
A crawler fetches pages from the web, finds the links in them, and fetches those in turn, so a search engine always has a recent copy of every page worth indexing. It's a postman delivering to every address in the country, who must visit each street often enough that nothing gets stale, yet never ring one doorbell twice in a second.
It's also asked as "design Googlebot" or "a concurrent web crawler", and its closest case study is the Distributed job scheduler, which also runs work by due time under leases. Interviewers like it because the hard parts are politeness to millions of sites, not repeating work across billions of URLs, and keeping pages fresh, all with numbers. Googlebot works much like this, setting its pace per site from how fast the site answers, though it also renders pages with an up-to-date Chromium, which this round leaves out.
Below is a full mock interview following the seven steps of the framework. You're the candidate: at each Guess before you read on, stop and answer first.
Step 1 · Clarify the features and cut the scope
Minutes 0–5 · How this step works
Interviewer: Design a web crawler for our search engine.
You: A few questions first. What do we keep, and who reads it?
Interviewer: The HTML of each page and its links. Indexing is another team's job.
You: How many pages, and how fresh?
Interviewer: About 5 billion pages we know of, each refreshed about once a month. News sites and busy pages daily.
You: Where does it start, and does it find new pages itself?
Interviewer: From a seed list and sites' sitemaps, then by following links.
You: What rules do we follow with sites?
Interviewer: Obey robots.txt and never overload anyone.
You: And pages that need JavaScript to show their content?
Interviewer: Not for now.
You: Then I'll cover fetching with politeness, not fetching the same URL or content twice, re-crawls, and storing raw pages for the indexer. Out: indexing and ranking, images and video, rendering JavaScript, and pages behind a login. OK?
Interviewer: Good.
Each answer shapes the design: a monthly refresh sets the fetch rate, politeness needs a queue per site, and following links means checking every link against what we've seen.