Practice
1. A web crawler must efficiently avoid re-crawling the same URLs too frequently while ensuring freshness. Which component best handles URL scheduling and politeness constraints?
easy
Solution
Step 1: Identify URL scheduling role
The URL Frontier manages which URLs to crawl next, enforcing politeness and freshness constraints.Step 2: Evaluate other components
PageRank ranks pages post-crawl, not for scheduling. Distributed KV stores hold content but don't schedule. Random distribution ignores politeness.Final Answer:
Option A -> Option AQuick Check:
URL Frontier enforces crawl politeness and freshness [check]
Hint: URL Frontier schedules URLs with politeness [check]
Common Mistakes:
2. In a sliding window rate limiter, at step 3 the system records a new request timestamp. What happens internally to the stored counters at this step?
easy
Solution
Step 1: Understand sliding window counter mechanics
Sliding window counters maintain timestamps of recent requests and remove those outside the window to keep an accurate count.Step 2: At step 3, old timestamps beyond the window are purged before adding the new request timestamp
This ensures the count reflects only requests within the sliding window duration.Final Answer:
Option A -> Option AQuick Check:
Sliding window removes expired timestamps before counting new requests [check]
Hint: Sliding window purges old timestamps before counting new ones [check]
Common Mistakes:
3. At 10x scale, which component in the News Feed system is most likely to fail first and why?
hard
Solution
Step 1: Analyze bottlenecks at 10x scale
Database (A) can be sharded; cache (C) scales horizontally; Kafka (D) can add partitions but has limits.Step 2: Delivery Workers face exponential fan-out growth
Fan-out queues grow with followers; Delivery Workers must push updates to millions more followers, causing processing lag and backlog.Final Answer:
Option B -> Option BQuick Check:
Delivery Workers bottleneck due to fan-out processing load [check]
Hint: Delivery Workers bottleneck on fan-out processing at scale [check]
Common Mistakes:
4. At 10x scale, which component in the Google Search architecture is most likely to become the first bottleneck, and why?
hard
Solution
Step 1: Analyze scaling challenges per component
The PageRank cluster faces superlinear growth in graph edges, causing memory and CPU bottlenecks.Step 2: Compare other components
URL Frontier can shard with heuristics; query serving scales with caching; storage bandwidth scales better than PageRank compute.Final Answer:
Option D -> Option DQuick Check:
PageRank graph growth causes first bottleneck at 10x scale [check]
Hint: PageRank graph grows superlinearly -> first bottleneck [check]
Common Mistakes:
5. At 10x scale, which component in a sliding window rate limiter is most likely to fail first and why?
hard
Solution
Step 1: Analyze sliding window memory scaling
Sliding window counters store timestamps for each request, so memory grows linearly with request volume.Step 2: At 10x scale, timestamp storage exhausts memory first, causing failures before other components become bottlenecks
Fixed window counters use constant memory, token/leaky buckets have fixed state sizes.Final Answer:
Option A -> Option AQuick Check:
Sliding window timestamp storage grows with traffic -> memory exhaustion [check]
Hint: Sliding window memory grows with requests, fixed window constant [check]
Common Mistakes:
