Practice
Solution
Step 1: Understand Update Worker hashing
Each hash function maps the event key to an index in the sketch array.Step 2: Increment counter at hashed index
The Count-Min Sketch increments the counter at that index to record the event occurrence.Final Answer:
Option B -> Option BQuick Check:
Update increments counters at hash indices to track frequencies [check]
Solution
Step 1: Trace Inventory Service check at Step 5
Inventory Service detects insufficient stock and cannot confirm order immediately.Step 2: Understand retry mechanism
System updates order to 'Pending Stock' and enqueues it for retry once stock replenishes, avoiding immediate cancellation or false confirmation.Final Answer:
Option C -> Option CQuick Check:
Insufficient stock -> 'Pending Stock' + retry queue [check]
Solution
Step 1: Identify the role of the distributed log
Kafka partitions by user ID to preserve ordering and durability, decoupling ingestion from delivery.Step 2: Eliminate other options
Relational DB triggers (A) cause synchronous blocking and don't scale; Redis (C) lacks durability and persistence; synchronous RPC (D) blocks on follower availability.Final Answer:
Option B -> Option BQuick Check:
Kafka partitions ensure durable, ordered, asynchronous fan-out [check]
Solution
Step 1: Evaluate latency and consistency trade-offs
Global synchronous quorum to all regions (A) causes high latency; asynchronous (B) sacrifices strong consistency.Step 2: Consider local quorum with global reconciliation
Local quorum writes reduce latency while global reconciliation maintains strong consistency.Final Answer:
Option D -> Option DQuick Check:
Local quorum + global reconciliation balances latency and consistency [check]
Solution
Step 1: Identify stateful bottlenecks at scale
Streaming servers maintain WebSocket connections which are stateful and tied to server memory.Step 2: Evaluate scaling challenges
Metadata DB (A) can be sharded; CDN caches (B) scale by adding regions; offline manager (D) limited by device, not server scale. Streaming servers (C) face connection limits and resharding complexity.Final Answer:
Option B -> Option BQuick Check:
Stateful WebSocket servers fail first at 10x scale [check]
