Practice
1. Without the consistent hashing ring metadata, what exactly breaks in a distributed cache system when a client requests a key?
medium
Solution
Step 1: Role of consistent hashing ring metadata
The ring metadata maps keys to nodes; without it, nodes cannot route requests correctly, leading to inconsistent data placement.Step 2: Consequence of missing ring metadata
Without this metadata, nodes lose synchronization on key ownership, causing data corruption as writes go to wrong nodes; request failure (The cache node receiving the request cannot determine the correct node, causing request failure or indefinite retry) is secondary, and fallback (The system falls back to a centralized database for all requests, increasing latency) is not automatic.Final Answer:
Option A -> Option AQuick Check:
Missing ring metadata causes data corruption due to lost key-node mapping [check]
Hint: No ring metadata -> lost key-node mapping -> data corruption [check]
Common Mistakes:
2. If the load balancer's health check component is removed, what exact failure occurs when a backend server crashes unexpectedly?
medium
Solution
Step 1: Understand health check role
The health check component detects backend server crashes and informs the load balancer to stop routing traffic to failed servers.Step 2: Trace failure without health checks
Without health checks, the load balancer is unaware of backend crashes and continues routing requests to the failed server, causing client requests to hang or timeout (The load balancer continues sending requests to the crashed backend, causing client timeouts).Step 3: Eliminate other options
The load balancer immediately detects the crash and reroutes traffic seamlessly is false because detection is missing. The backend server automatically restarts and recovers without affecting traffic is unrelated to load balancer behavior. Clients receive error responses directly from the crashed backend server is incorrect because crashed servers cannot respond.Final Answer:
Option A -> Option AQuick Check:
No health checks -> load balancer sends requests to crashed backend causing timeouts [check]
Hint: No health checks -> requests sent to dead servers cause timeouts [check]
Common Mistakes:
3. At 10x scale, which component is most likely to fail first and why in Facebook Messenger's group chat system?
hard
Solution
Step 1: Analyze stateful components at 10x scale
Chat Servers maintain WebSocket connections bound to server memory, limiting horizontal scaling.Step 2: Compare other components
Databases and Kafka can be sharded or scaled; Redis TTL issues cause transient problems but not first failure.Final Answer:
Option A -> Option AQuick Check:
Stateful WebSocket connections -> Chat Servers bottleneck at scale [check]
Hint: Stateful WebSocket binds connections -> Chat Servers bottleneck [OK]
Common Mistakes:
4. At 10x traffic scale, which component is most likely to fail first and why?
hard
Solution
Step 1: Identify stateful bottlenecks
Chat servers maintain WebSocket connections statefully, binding clients to specific servers.Step 2: Scaling challenges
At 10x scale, adding servers doesn't move existing connections, causing uneven load and resource exhaustion.Step 3: Why others fail later
Databases can be sharded (The database because it cannot handle increased write throughput without sharding), load balancers scale horizontally (The load balancer because it cannot distribute connections evenly at high scale), and CDNs handle scale well (The CDN because cache invalidation delays increase latency).Final Answer:
Option A -> Option AQuick Check:
Stateful WebSocket servers -> resharding limits cause first failure [check]
Hint: Stateful WebSocket servers fail first at scale due to reshard limits [OK]
Common Mistakes:
5. At 10x scale, which component in an async messaging chat system fails first and why?
hard
Solution
Step 1: Analyze stateful components and scaling challenges
Databases (The database, because increased writes cause lock contention) can be scaled with sharding and replicas. Message queue brokers (The message queue brokers, due to partition leader overload) scale horizontally with partitions. Delivery workers (The delivery workers, because retry queues grow exponentially) can be scaled with backpressure.Step 2: Identify chat servers as stateful WebSocket connection holders
Chat servers maintain persistent WebSocket connections bound to server memory, making resharding or migration difficult at scale.Final Answer:
Option C -> Option CQuick Check:
Stateful WebSocket servers -> first bottleneck at 10x scale [check]
Hint: Stateful WebSocket servers limit horizontal scaling first [check]
Common Mistakes:
