Practice
Solution
Step 1: Trace circuit breaker decision at Step 4
When failure count exceeds threshold, the circuit breaker transitions to OPEN state and stops forwarding requests.Step 2: Understand behavior on open circuit
Requests are immediately failed (B), not forwarded (A), retried (C), or queued (D).Final Answer:
Option A -> Option AQuick Check:
Open circuit returns error immediately without downstream call [check]
Solution
Step 1: Analyze CAP trade-offs
Prioritizing availability over consistency during partitions means relaxing strict consensus.Step 2: Evaluate options
Raft and Paxos enforce strong consistency, sacrificing availability; centralized locks create single points of failure; eventual consistency allows availability with conflict resolution.Final Answer:
Option C -> Option CQuick Check:
Eventual consistency favors availability during partitions [check]
Solution
Step 1: Understand flash sale constraints
Flash sales require high availability and low latency during spikes; strict consistency can cause blocking and failures.Step 2: Evaluate architectures
Strong consistency with sync replication (A) causes high latency and availability loss under partitions. Single master (C) bottlenecks writes. Distributed locks (D) serialize requests, hurting throughput. Eventually consistent cache with async writes (B) allows high availability and scales under burst, tolerating slight delays.Final Answer:
Option A -> Option AQuick Check:
Async writes + eventual consistency -> high availability under spikes [check]
Solution
Step 1: Role of the broker
The broker decouples producers and subscribers, buffering messages and ensuring reliable delivery. Without it, producers must send directly to subscribers.Step 2: Consequences of no broker
Direct synchronous sends cause producers to block if subscribers are slow or unavailable, risking message loss or backpressure. Duplication (Messages are duplicated because the broker cannot deduplicate) and ordering (Subscribers receive messages out of order due to lack of broker ordering guarantees) issues are secondary effects managed by the broker. Encryption (Messages are encrypted incorrectly causing delivery failures) is unrelated.Final Answer:
Option A -> Option AQuick Check:
No broker -> producer blocks or loses messages on slow subscribers [check]
Solution
Step 1: Identify stateful bottlenecks at scale
The Idempotency Store holds global state and is hard to shard, limiting horizontal scaling.Step 2: Evaluate other components
Settlement Service can be scaled with partitioned batches; client SDK is client-side and less critical; load balancer scales horizontally with modern tech.Final Answer:
Option B -> Option BQuick Check:
Centralized idempotency store -> scaling bottleneck at 10x load [check]
