Practice
Solution
Step 1: Understand shard assignment requirements
Modulo hashing (Use a modulo-based hash function on the primary key to assign shards directly) causes massive remapping when shards change; centralized lookup (Assign shards based on a centralized lookup table updated on every shard change) creates a bottleneck and single point of failure; range partitioning (Use range-based partitioning with fixed key ranges per shard) can cause hotspots and uneven load.Step 2: Evaluate consistent hashing benefits
Consistent hashing with virtual nodes (Implement consistent hashing with virtual nodes to map keys to shards) evenly distributes keys and minimizes remapping when shards are added or removed, making it ideal for dynamic shard management.Final Answer:
Option B -> Option BQuick Check:
Consistent hashing minimizes shard remapping on topology changes [check]
Solution
Step 1: Identify priority and scale requirements
A relational DB (A) struggles with high write throughput and priority ordering at scale; simple FIFO queues (C) lack priority support; cron jobs (D) do not coordinate distributed execution or priority.Step 2: Evaluate distributed priority queue
A distributed priority queue with partitioned shards (B) can scale horizontally, maintain priority ordering per shard, and support exactly-once execution semantics.Final Answer:
Option A -> Option AQuick Check:
Distributed priority queue shards scale and preserve ordering [check]
Solution
Step 1: Understand Duplicate Detection behavior at Step 5
If the URL has been seen before, it is filtered out to prevent redundant crawling.Step 2: Eliminate other options
Re-queuing duplicates wastes resources; marking for delayed re-crawl is a separate process; Politeness Policy Manager handles timing, not duplication.Final Answer:
Option A -> Option AQuick Check:
Duplicate Detection discards seen URLs to avoid redundancy [check]
Solution
Step 1: Understand Kafka's role in decoupling send and delivery
Kafka buffers messages asynchronously; without it, Chat Server must synchronously contact Bob's server.Step 2: Trace failure without Kafka
If Bob's server is slow or crashes, Alice's send blocks or message is lost with no retry, breaking reliability.Final Answer:
Option C -> Option CQuick Check:
No Kafka -> synchronous send blocks, message loss on Bob's crash [check]
Solution
Step 1: Analyze scale impact on components
Global aggregator (A) merges asynchronously, so less likely bottleneck. Replication overhead (C) grows but can be optimized. Client counters (D) can compact state.Step 2: Identify shard replicas failure mode
At 10x scale, network partitions increase, causing shards to diverge permanently without reconciliation, breaking eventual consistency.Final Answer:
Option A -> Option AQuick Check:
Network partitions cause shard divergence first at scale [check]
