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: Trace Long Polling request lifecycle
In Long Polling, the client sends a request and waits for the server to respond. Upon receiving the response, the client immediately sends a new request.Step 2: Determine client state at step 4
At step 4, the previous connection is closed, and the client has an open new HTTP request waiting for the server's next response.Final Answer:
Option D -> Option DQuick Check:
Long Polling client sends new request immediately after response [check]
Solution
Step 1: Understand Master Node role
Master Node manages cluster state and shard allocation; without it, no new assignments occur.Step 2: Trace failure impact
Existing primary shards continue indexing; replica syncing halts due to no cluster state updates; search queries may still work on available shards.Final Answer:
Option C -> Option CQuick Check:
Without Master, replica syncing stops but primaries index [check]
Solution
Step 1: Evaluate modulo hashing with fixed partitions
Modulo hashing causes large remapping on node changes, poor for frequent changes.Step 2: Compare consistent hashing with virtual nodes
Virtual nodes spread load evenly and reduce remapping, ideal for frequent node changes.Final Answer:
Option D -> Option DQuick Check:
Virtual nodes in consistent hashing balance load and minimize remapping [check]
Solution
Step 1: Analyze component scalability at 10x load
CDN edge caches (A) scale horizontally and are designed for massive read throughput. Transcoding pipeline (C) can be scaled with more workers. Upload service (D) can be scaled with load balancers and stateless servers.Step 2: Identify view count database bottleneck
View count DB is a centralized write hotspot with high contention and latency sensitivity. At 10x scale, it becomes the first bottleneck due to write amplification and consistency requirements.Final Answer:
Option B -> Option BQuick Check:
Centralized view count DB write bottleneck fails first [check]
