Practice
Solution
Step 1: Identify PACELC trade-off
During partitions (P), latency (L) matters; asynchronous replication allows local reads with low latency.Step 2: Evaluate options for latency under partition
Synchronous replication (A) and quorum (D) increase latency; single primary (C) risks unavailability if primary is unreachable.Final Answer:
Option A -> Option AQuick Check:
Asynchronous replication -> low latency reads during partitions [check]
Solution
Step 1: Identify DAU Estimator role
DAU Estimator provides daily active user count critical for bandwidth calculations as bandwidth depends on total active users.Step 2: Eliminate other options
The system cannot estimate peak QPS, causing under-provisioning of servers is incorrect because peak QPS depends on instantaneous requests, not just DAU; Storage estimation becomes inaccurate because DAU is a key multiplier for daily data volume is partially true but storage depends more on total objects, not DAU alone; User authentication fails because DAU tracks active sessions is unrelated to authentication.Final Answer:
Option A -> Option AQuick Check:
Bandwidth depends directly on DAU for total data transfer [check]
Solution
Step 1: Evaluate Redis SETNX under high contention
Redis SETNX with TTL (A) is fast but can cause split-brain and stale locks under network partitions, violating correctness.Step 2: Consider consensus-based lock service
Consensus-based services like etcd (B) provide strong consistency and fault tolerance, ensuring correctness even if latency is higher.Step 3: Assess database row locks and local locks
Database locks (C) have high latency and risk deadlocks; local locks (D) do not coordinate across nodes, failing correctness.Final Answer:
Option B -> Option BQuick Check:
Consensus ensures correctness under contention despite latency [check]
Solution
Step 1: Analyze database scaling
Databases can be sharded and scaled horizontally; not usually the first bottleneck.Step 2: Analyze fan-out service scaling
Push-based fan-out causes write amplification proportional to follower count; at 10x scale, this bottleneck grows superlinearly and saturates first.Step 3: Analyze cache and web servers
Caches can be scaled with eviction and sharding; web servers scale with load balancers and stateless design.Final Answer:
Option A -> Option AQuick Check:
Fan-out write amplification causes first bottleneck at 10x scale [check]
Solution
Step 1: Analyze scaling bottlenecks
Road Graph DB (A) can be sharded; ingestion pipeline (C) can scale horizontally; client rendering (D) is local and less critical.Step 2: Identify Routing Engine CPU bottleneck
Routing Engine performs complex shortest path computations per request; 10x load causes CPU saturation and latency spikes, failing first.Final Answer:
Option C -> Option CQuick Check:
Routing Engine CPU-bound under 10x load causes first failure [check]
