Practice
Solution
Step 1: Understand Delivery Worker role at Step 4
It checks recipient online status cache to decide delivery method.Step 2: Behavior on expired cache entry
Expired cache means unknown status; system falls back to persistent queue to ensure message is not lost.Final Answer:
Option A -> Option AQuick Check:
Expired cache triggers fallback to persistent queue [check]
Solution
Step 1: Understand key remapping minimization
Simple modulo hashing (Use a simple modulo-based hash function on node count to assign keys) causes massive remapping when node count changes; random assignment (Assign keys randomly to nodes and rebalance periodically) lacks stability; centralized directory (Use a centralized directory service mapping keys to nodes) adds single point of failure and latency.Step 2: Consistent hashing with virtual nodes
Consistent hashing distributes keys on a ring, and virtual nodes smooth load; adding/removing nodes only remaps a small subset of keys.Final Answer:
Option D -> Option DQuick Check:
Consistent hashing minimizes key remapping on node changes [check]
Solution
Step 1: Understand distributed lock requirements
Single Redis instance with SETNX risks single point of failure and split-brain issues.Step 2: Evaluate Redlock's multi-instance coordination
Redlock uses multiple Redis masters to reduce risk of deadlocks and ensure safety under partial failures.Final Answer:
Option A -> Option AQuick Check:
Redlock coordinates multiple Redis masters for safer distributed locks [check]
Solution
Step 1: Trace failure impact of Signaling Server crash after forwarding offer
If the server crashes before recording the offer state, it may resend the offer when restarted, causing duplicates.Step 2: Analyze other options
No immediate error (A) is unlikely; indefinite ringing (B) happens if answer lost but not duplicated; media server (D) does not start without signaling.Final Answer:
Option D -> Option DQuick Check:
Signaling crash causes duplicate offers, confusing Bob's client [check]
Solution
Step 1: Analyze stateful vs stateless components at scale
Relational DB (The relational database storing user profiles, due to increased read queries) can be scaled with read replicas; Kafka (The Kafka cluster, due to partition leader election delays under heavy load) scales well with partitions. Ranking cache (The ranking service's in-memory cache, because it cannot shard scores by post_id effectively) can shard by post_id.Step 2: Identify WebSocket server bottleneck
WebSocket servers hold stateful connections bound to server memory; these connections cannot be moved easily, limiting horizontal scaling and causing failures under 10x load.Final Answer:
Option C -> Option CQuick Check:
Stateful WebSocket servers fail first due to unshardable live connections [check]
