Practice
Solution
Step 1: Identify the decoupling requirement
Relational DB with row-level locking (Use a relational database with row-level locking to queue messages) cannot handle 1M writes/sec due to locking and durability overhead. Redis (Use Redis as an in-memory queue with TTL for message expiration) lacks durability guarantees and TTL causes message loss risk. Direct synchronous calls (Use direct synchronous HTTP calls from sender to all recipients) block sender and don't scale.Step 2: Evaluate Kafka's suitability
Kafka partitions by conversation ID ensure ordering and durability, enabling scalable fan-out with consumer groups.Final Answer:
Option A -> Option AQuick Check:
Kafka partitions -> durable, scalable decoupling [check]
Solution
Step 1: Trace Ranking Service behavior at step 4
Ranking Service combines candidate suggestions with personalization data; if missing, it must still return relevant results.Step 2: Evaluate fallback strategies
Blocking for personalization data (C) causes latency; empty results (A) degrade UX; querying Trie again (D) is unrelated. Falling back to global popularity ranking ensures responsiveness.Final Answer:
Option C -> Option CQuick Check:
Ranking Service fallback -> global popularity ranking [check]
Solution
Step 1: Trace failure impact of Duplicate Detection silent failure
Without filtering, duplicate URLs flood the system causing repeated fetches.Step 2: Eliminate other options
Scheduler overload is secondary; Politeness Policy unaffected by duplicates; URL Frontier typically handles duplicates gracefully.Final Answer:
Option D -> Option DQuick Check:
Duplicate Detection failure causes repeated URL fetches [check]
Solution
Step 1: Role of relationship index
The index enables efficient lookup of edges; without it, traversal cannot proceed correctly.Step 2: Behavior without index
Queries relying on the index return empty results silently because no edges are found, not errors or scans.Final Answer:
Option A -> Option AQuick Check:
Missing index causes silent empty results, not crashes or scans [check]
Solution
Step 1: Identify bottleneck in distributed updates
Centralized coordinator serializes updates to maintain consistency, limiting throughput.Step 2: Analyze other components
Network bandwidth and hash function speed scale better; sketch arrays have fixed size but don't overflow.Step 3: Understand scale impact
At 10x scale, coordinator becomes overwhelmed, causing update latency and failures.Final Answer:
Option D -> Option DQuick Check:
Central coordinator serialization bottlenecks updates at scale [check]
