Practice
Solution
Step 1: Understand key distribution and remapping
Modulo-based hashing (A simple modulo-based hash function assigning keys to servers by key % server_count) causes massive remapping when server count changes, violating minimal reshuffling.Step 2: Evaluate consistent hashing with virtual nodes
Consistent hashing with virtual nodes (A consistent hashing ring with virtual nodes to balance load and reduce remapping) evenly distributes keys and minimizes remapping on node changes.Final Answer:
Option C -> Option CQuick Check:
Virtual nodes in consistent hashing minimize key remapping on node changes [check]
Solution
Step 1: Analyze memory and false positive trade-offs
A single global Bloom filter grows large and has higher false positive rates due to keyspace size; partitioning per shard reduces filter size and localizes false positives.Step 2: Evaluate alternatives
Counting Bloom filters allow deletions but consume more memory, which is costly at large scale; caching recent keys does not guarantee absence and can miss cold keys.Final Answer:
Option B -> Option BQuick Check:
Partitioned Bloom filters balance memory and false positives at scale [check]
Solution
Step 1: Consider client compatibility
Mobile clients often have limited or inconsistent HTTP/2 support, making HTTP/2 server push (A) and gRPC streaming (D) unreliable.Step 2: Evaluate streaming methods
WebSocket (C) is not natively supported by HLS players and complicates caching/CDN usage. HTTP/1.1 chunked transfer encoding (B) allows progressive delivery compatible with most clients and CDNs.Final Answer:
Option A -> Option AQuick Check:
HTTP/1.1 chunked encoding streams HLS segments progressively and broadly supported [check]
Solution
Step 1: Analyze log storage requirements
Logs are write-once, large volume, and require fast analytical queries.Step 2: Evaluate columnar data warehouse
Columnar stores optimize for append-only writes and fast scans, reducing cost and improving query speed.Final Answer:
Option C -> Option CQuick Check:
Columnar warehouse -> optimized for append-only and analytics [check]
Solution
Step 1: Identify stateful components at scale
Chat servers maintain stateful TCP connections, each consuming resources like memory and CPU.Step 2: Analyze scaling impact
At 10x scale, the number of concurrent TCP connections overwhelms server resources, causing failures before database or network components.Final Answer:
Option A -> Option AQuick Check:
Stateful TCP connections -> chat servers bottleneck first [check]
