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: 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: Analyze client connectivity constraints
Mobile clients often have intermittent connectivity and poor support for HTTP/2 streaming.Step 2: Evaluate streaming options
Direct gRPC streaming (A) is unreliable on mobile. WebSockets (C) add complexity and JSON is less efficient. REST long polling (D) is less efficient and higher latency. Unary calls with polling and backoff (B) handle intermittent connectivity gracefully.Final Answer:
Option B -> Option BQuick Check:
Mobile intermittent -> unary calls + polling with backoff [check]
Solution
Step 1: Analyze PACELC trade-offs for read latency during partitions
Minimizing read latency favors local reads and asynchronous replication despite weaker consistency.Step 2: Evaluate architectures
Synchronous replication (A) and quorum (D) increase latency; single primary (C) risks unavailability if primary is unreachable.Final Answer:
Option D -> Option DQuick Check:
Eventual consistency + async replication -> low read latency under partition [check]
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]
