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 primary-replica system, what exactly breaks if the replication log (WAL) on the primary is lost before being sent to replicas?
medium
Solution
Step 1: Understand WAL role in replication
WAL is the source of truth for replicas to catch up incrementally.Step 2: Trace failure impact
If WAL is lost, replicas cannot catch up incrementally and must request full snapshot, causing load and delay.Final Answer:
Option A -> Option AQuick Check:
Lost WAL -> replicas request full snapshot -> recovery delay [check]
Hint: Lost WAL -> full snapshot fetch delays recovery [check]
Common Mistakes:
3. At 10x scale, which component in the notification system is most likely to fail first and why?
hard
Solution
Step 1: Analyze Delivery Worker scalability
Delivery Workers are CPU and thread-bound; increasing scale requires more workers, but thread limits and resource contention cause bottlenecks.Step 2: Compare other components
Relational DB (A) can be sharded; push gateways (C) are rate-limited but can be scaled with multiple credentials; presence cache (D) can be sharded with consistent hashing.Final Answer:
Option A -> Option AQuick Check:
Delivery Workers hit thread and CPU limits first at 10x scale [check]
Hint: Delivery Workers hit thread limits before other components [check]
Common Mistakes:
4. 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:
5. At 10x scale, which component in a system using TLS for encryption in transit is most likely to become the bottleneck first, and why?
hard
Solution
Step 1: Identify TLS termination proxy role
It handles all TLS handshakes which are CPU-intensive, especially at high connection rates.Step 2: Compare other components
Application servers offload encryption to TLS proxy; load balancer scales horizontally; database impact is unrelated to TLS termination.Final Answer:
Option A -> Option AQuick Check:
TLS proxy CPU-bound on handshakes -> first bottleneck at scale [check]
Hint: TLS handshake CPU load hits termination proxy first [check]
Common Mistakes:
