Practice
Solution
Step 1: Trace Matching Service behavior at step 4
Matching Service queries Surge Pricing Service for multiplier to calculate fare.Step 2: Understand stale data impact
If surge multiplier is stale due to cache lag, Matching Service proceeds with returned value, causing temporary fare mispricing but no blocking or retries.Final Answer:
Option D -> Option DQuick Check:
Matching Service tolerates stale surge multiplier for availability [check]
Solution
Step 1: Identify consistency and latency requirements
Strong consistency requires synchronous replication; low latency demands minimal delay.Step 2: Evaluate architecture options
Single primary DB with sync replication ensures consistency but may increase latency slightly; best trade-off.Final Answer:
Option B -> Option BQuick Check:
Synchronous replication balances strong consistency and latency [check]
Solution
Step 1: Understand KMS role in key lifecycle
KMS generates and manages encryption keys; if unavailable, new keys can't be created but existing keys cached locally allow decryption.Step 2: Eliminate incorrect failure modes
Encryption doesn't stop immediately; decryption continues with cached keys; system does not fallback to unencrypted storage automatically.Final Answer:
Option A -> Option AQuick Check:
KMS outage blocks new key generation, existing keys still usable [check]
Solution
Step 1: Analyze requirements
Strong consistency and complex joins require relational capabilities and transactional integrity across shards.Step 2: Evaluate options
Sharded relational DB with two-phase commit supports distributed transactions and joins, unlike NoSQL or cache-based approaches.Final Answer:
Option A -> Option AQuick Check:
Sharded RDB + 2PC balances scale and ACID [check]
Solution
Step 1: Identify components stressed by 10x scale
Database scaling is often handled by sharding or replicas; load balancers scale horizontally; client SDKs are local.Step 2: Recognize GraphQL parsing and validation cost
Parsing and complexity validation are CPU-bound and happen per request, becoming CPU bottlenecks at high request rates.Final Answer:
Option B -> Option BQuick Check:
GraphQL validation CPU cost scales linearly with requests [check]
