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 Inventory Service behavior at Step 4
Inventory Service performs a synchronous stock check; if stock is insufficient, it rejects the order immediately to prevent overselling.Step 2: Evaluate other options
Queuing for retry (A) delays user feedback and risks overselling. Partial reservation (C) is inconsistent with flash sale atomicity. Forwarding to Payment (D) without stock confirmation breaks order integrity.Final Answer:
Option A -> Option AQuick Check:
Inventory rejects insufficient stock immediately [check]
Solution
Step 1: Trace Feed Worker behavior at cache miss
When TTL expires, the cache is stale. The Feed Worker must avoid blocking feed generation.Step 2: Understand asynchronous cache refresh
To maintain low latency, the Feed Worker returns empty stories immediately and triggers async cache refresh. Blocking fetch (B) would increase latency. Returning stale data (A) risks outdated content. Skipping stories silently (C) loses user experience.Final Answer:
Option A -> Option AQuick Check:
Async cache refresh avoids blocking feed generation [check]
Solution
Step 1: Understand memory constraints and error tolerance
Storing all user IDs explicitly (Redis or relational DB) is memory-heavy and not scalable for large user bases.Step 2: Identify HyperLogLog's role
HyperLogLog provides approximate unique counts with fixed small memory and tunable error, ideal for large-scale cardinality estimation.Final Answer:
Option C -> Option CQuick Check:
HyperLogLog trades accuracy for memory efficiency [check]
Solution
Step 1: Analyze scaling impact on Coordinating Node
Coordinating Nodes merge and sort results from all shards; with 10x shards, merging overhead grows significantly.Step 2: Compare other components
Master Node scales with cluster state but less impacted than query merging; Data Nodes handle replication but network can be scaled; Ingest Nodes can be scaled horizontally.Final Answer:
Option D -> Option DQuick Check:
Coordinating Node merging overhead grows fastest at scale [check]
