Practice
1. In a cache stampede prevention system, at Step 4 the Cache Rebuilder checks if a distributed lock is held before regenerating the cache. What happens if the lock is already held by another process?
easy
Solution
Step 1: Trace Cache Rebuilder behavior at Step 4
If the distributed lock is held, another process is regenerating the cache.Step 2: Understand correct handling
The Cache Rebuilder waits or serves stale data to avoid duplicate regeneration and backend overload.Final Answer:
Option B -> Option BQuick Check:
Waiting or serving stale data prevents duplicate cache rebuilds [check]
Hint: Lock held -> wait or serve stale, no duplicate rebuilds [OK]
Common Mistakes:
2. If the Kafka broker cluster goes down unexpectedly, what exactly breaks in the message delivery pipeline?
medium
Solution
Step 1: Trace producer behavior on broker failure
Producers get errors on send; without retries, messages are lost. They do not block indefinitely (A).Step 2: Trace consumer behavior
Consumers cannot fetch new messages; cached messages may be consumed but no new delivery occurs, causing stalls. Duplication (D) is prevented by offset commits.Final Answer:
Option A -> Option AQuick Check:
Broker failure causes producer errors and consumer stalls, risking message loss [check]
Hint: Broker down -> producer errors, consumer stalls, possible message loss [check]
Common Mistakes:
3. For a multiplayer online game requiring real-time position updates with minimal delay, which transport protocol and design choice best balances speed and reliability?
medium
Solution
Step 1: Analyze game requirements
Real-time position updates require low latency but some reliability to avoid inconsistent state.Step 2: Evaluate protocol trade-offs
UDP provides low latency; adding application-level sequence numbers and selective retransmission balances speed and reliability.Final Answer:
Option C -> Option CQuick Check:
UDP + app-level reliability fits real-time game updates [check]
Hint: UDP + app reliability balances speed and correctness [check]
Common Mistakes:
4. Without a rate limiter in place, what exactly happens when a sudden traffic spike occurs on a backend service?
medium
Solution
Step 1: Understand backend behavior without rate limiting
Without rate limiting, traffic spikes overwhelm backend, causing resource exhaustion and crashes or unresponsiveness.Step 2: Eliminate incorrect failure modes
Automatic instant scaling (C) is unrealistic; graceful rejection (D) requires rate limiting; queuing all requests (A) leads to resource exhaustion and eventual failure.Final Answer:
Option A -> Option AQuick Check:
Spike without limiter -> backend crash or unresponsiveness [check]
Hint: No limiter -> spike crashes backend, causing timeouts [check]
Common Mistakes:
5. At 10x scale, which component in a real-time chat system implementing CAP theorem fails first and why?
hard
Solution
Step 1: Identify stateful bottleneck
Chat servers maintain WebSocket connections statefully, limiting horizontal scaling.Step 2: Understand scaling impact
At 10x scale, existing WebSocket connections cannot be moved, causing chat servers to saturate first.Final Answer:
Option C -> Option CQuick Check:
Stateful WebSocket servers bottleneck scaling before DB or load balancer [check]
Hint: Stateful WebSocket servers bottleneck scaling first [check]
Common Mistakes:
