Practice
Solution
Step 1: Understand consistency requirements
Strong consistency requires writes to be serialized and acknowledged before success.Step 2: Evaluate replication patterns
Primary-replica with synchronous writes ensures all writes go through a single primary, preserving consistency. Multi-primary with async or eventual consistency cannot guarantee strong consistency.Final Answer:
Option D -> Option DQuick Check:
Primary sync writes -> strong consistency, tolerates partitions by blocking writes [check]
Solution
Step 1: Understand failure handling at Application Processor
Transient DB errors should not block user workflow or cause permanent failure.Step 2: Evaluate options
Immediate retry blocking (A) hurts latency; skipping update (C) loses data; rolling back entire submission (D) is heavy-handed. Queuing for async retry (B) ensures eventual consistency without blocking.Final Answer:
Option B -> Option BQuick Check:
Async retry decouples transient failures from user flow [check]
Solution
Step 1: Identify role of event queue
The event queue asynchronously propagates updates to read replicas.Step 2: Trace failure impact
If the queue fails, read replicas stop receiving updates and serve stale data indefinitely.Final Answer:
Option B -> Option BQuick Check:
Queue failure causes stale reads, no automatic failover [check]
Solution
Step 1: Identify stateful components in location tracking
WebSocket servers hold persistent connections per driver and rider, consuming memory and CPU.Step 2: Analyze scaling challenges
At 10x scale, WebSocket servers hit connection limits and memory pressure first; databases can shard and cache; surge pricing is stateless and scalable; mobile clients scale independently.Final Answer:
Option B -> Option BQuick Check:
Stateful WebSocket servers bottleneck first due to connection limits [check]
Solution
Step 1: Identify system components at scale
Rendezvous Hashing is decentralized, so no central coordinator (The central coordinator fails due to increased coordination overhead) exists. Nodes do not broadcast state to all others (The network bandwidth saturates because all nodes broadcast state to each other) in typical implementations.Step 2: Analyze client-side routing impact
Clients must compute scores for all nodes to pick highest; at 10x scale, this computation and memory for node lists become bottlenecks.Step 3: Consider hash computation cost
Hash computations (The hash function computation becomes a CPU bottleneck due to increased node and key counts) are lightweight compared to maintaining large node lists and score computations.Final Answer:
Option A -> Option AQuick Check:
Client routing logic scales poorly with node list size -> bottleneck [check]
