Practice
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]
Solution
Step 1: Trace Cache Loader timeout behavior
On timeout, Cache Loader skips warming that key to avoid blocking the entire warming process.Step 2: Eliminate retry and fallback options
Indefinite retries block warming; fallback cache is not part of warming design; null writes risk stale data.Final Answer:
Option C -> Option CQuick Check:
Timeout causes skipping key warming to maintain overall progress [check]
Solution
Step 1: Analyze latency and dependency constraints
Elasticsearch involves network calls and disk I/O, increasing latency and external dependencies, so it's unsuitable for minimal latency prefix lookups.Step 2: Evaluate data structure suitability
A Trie provides efficient in-memory prefix matching with O(k) lookup time (k = prefix length), ideal for millions of concurrent users with minimal latency.Final Answer:
Option C -> Option CQuick Check:
Trie offers fast prefix search with no external calls [check]
Solution
Step 1: Trace failure impact of Kafka unavailability
Kafka unavailability blocks producers or causes retries; delivery workers cannot fetch messages from Kafka.Step 2: Evaluate fallback mechanisms
In a robust design, a backup queue or dead-letter queue is used to avoid message loss; synchronous HTTP fallback (D) is not automatic; silent loss (A) is unacceptable.Final Answer:
Option C -> Option CQuick Check:
Backup queue prevents message loss during Kafka downtime [check]
Solution
Step 1: Identify stateful bottlenecks at 10x scale
Databases (A) and message queues (C) can be scaled horizontally with sharding and partitioning. Load balancers (D) are stateless and scale well with more instances.Step 2: Understand WebSocket connection statefulness
Chat servers maintain persistent WebSocket connections bound to server memory. These connections cannot be moved or resharded easily, causing chat servers to hit resource limits first.Final Answer:
Option D -> Option DQuick Check:
Stateful WebSocket connections -> chat servers bottleneck first at scale [check]
