Practice
Solution
Step 1: Understand directory-based sharding
Directory-based sharding uses a centralized mapping from keys to shards.Step 2: Trace step 3 action
The Shard Lookup Service consults the directory to find the exact shard for user ID 12345.Final Answer:
Option A -> Option AQuick Check:
Directory lookup returns shard for specific key [check]
Solution
Step 1: Understand Kafka offset commit semantics
Kafka consumers commit offsets only after processing messages successfully to avoid reprocessing.Step 2: Delivery Worker behavior on acknowledgment
Upon downstream acknowledgment, the worker marks the message as delivered and commits the offset, signaling safe processing.Final Answer:
Option C -> Option CQuick Check:
Offset commit after acknowledgment ensures exactly-once processing [check]
Solution
Step 1: Understand Kafka's role in ingestion
Kafka decouples ingestion; if unavailable, producers (WebSocket Server) cannot push messages.Step 2: Trace failure impact
WebSocket Server buffers updates temporarily but memory is limited; blocking would cause backpressure but usually async buffers exist.Final Answer:
Option A -> Option AQuick Check:
Kafka outage causes buffering, not silent loss or blocking immediately [check]
Solution
Step 1: Analyze centralized vs distributed scheduling
Centralized Scheduler becomes a bottleneck at scale; distributed sharding allows parallelism and localized politeness enforcement.Step 2: Evaluate other options
Independent crawlers without shared politeness risk domain overload; single-threaded crawler can't scale to millions of domains.Final Answer:
Option B -> Option BQuick Check:
Distributed sharding enables scalable politeness enforcement [check]
Solution
Step 1: Role of Kafka in playlist updates
Kafka asynchronously logs playlist metadata changes for durability and fan-out.Step 2: Failure impact if Kafka unavailable
Without Kafka, updates sent to it are lost silently as no retry or buffering is implemented; UI does not block (B) because updates are async; local queuing (D) is not implemented; offline play (A) unaffected.Final Answer:
Option A -> Option AQuick Check:
Kafka down -> updates lost silently, no retry [check]
