Practice
Solution
Step 1: Identify cache update timing
Write-Through updates cache and database synchronously, ensuring cache is always fresh.Step 2: Eliminate other patterns
Cache Aside updates cache only on misses, risking stale cache after writes; Read-Through only loads on reads; Write-Behind delays DB update, risking stale cache.Final Answer:
Option B -> Option BQuick Check:
Write-Through synchronously updates cache and DB [check]
Solution
Step 1: Identify idempotency enforcement point
The transaction processing service must track unique request IDs to prevent duplicate charges, as it controls payment execution.Step 2: Eliminate other options
The load balancer cannot reliably detect duplicates due to statelessness; the database unique constraints cannot cover all idempotency cases; client SDK retries are unreliable and cannot guarantee global idempotency.Final Answer:
Option D -> Option DQuick Check:
Transaction service stores request IDs -> prevents duplicate processing [check]
Solution
Step 1: Understand role of partition-tolerant queue
Kafka decouples sender and receiver, buffering messages during partitions.Step 2: Trace failure without Kafka
Without Kafka, sender blocks waiting for receiver; if receiver crashes, message is lost with no retry.Final Answer:
Option A -> Option AQuick Check:
Without Kafka, sender blocks and loses messages if receiver crashes [check]
Solution
Step 1: Understand modular hashing failure on node removal
Modular hashing requires remapping all keys, causing performance degradation and cache misses.Step 2: Evaluate options
The system automatically replicates keys to other nodes without delay incorrectly assumes automatic replication without delay; Clients continue to query the removed node causing request failures is invalid as clients rely on updated routing.Final Answer:
Option B -> Option BQuick Check:
Without consistent hashing, remapping causes cache stampede, no instant replication [check]
Solution
Step 1: Analyze vector search scaling
Vector search scales with index size but can shard horizontally; query latency grows but not immediate failure (A incorrect).Step 2: Assess code generator scaling
GPU saturation is a bottleneck but can be mitigated by batching and autoscaling (B less immediate).Step 3: Evaluate API gateway
API gateways are stateless and horizontally scalable (C incorrect).Step 4: Identify WebSocket server bottleneck
WebSocket servers hold stateful connections bound to server memory; sharding existing connections is complex, causing first failure at 10x scale (D correct).Final Answer:
Option C -> Option CQuick Check:
Stateful WebSocket connections limit server scaling [check]
