Practice
Solution
Step 1: Trace Availability Service behavior at step 4
The service uses cache for fast reads but must ensure correctness before booking confirmation.Step 2: Handle stale or missing cache entries
Rejecting immediately (A) reduces UX; optimistic booking (C) risks double bookings; async delay (D) hurts latency. Synchronous DB query (B) ensures correctness.Final Answer:
Option B -> Option BQuick Check:
Fallback to DB ensures accurate availability check on cache miss [check]
Solution
Step 1: Evaluate exact counts vs approximation
Exact counts require large memory and high latency for heavy skew data streams.Step 2: Recognize Count-Min Sketch with conservative update
Conservative update reduces overestimation bias, improving accuracy for skewed data.Step 3: Eliminate Bloom filter and HyperLogLog
Bloom filters don't count frequencies; HyperLogLog estimates cardinality, not frequency.Final Answer:
Option A -> Option AQuick Check:
Conservative update Count-Min Sketch balances accuracy and memory for skewed streams [check]
Solution
Step 1: Analyze real-time personalization needs
Low latency and frequent profile updates require online, streaming data processing.Step 2: Evaluate architectures
Batch (A) is too stale; static precomputed scores (C) can't adapt quickly; client-side filtering (D) lacks server-side intelligence. Online feature store with streaming (B) supports fresh data and low latency scoring.Final Answer:
Option C -> Option CQuick Check:
Streaming updates + real-time scoring -> fresh personalized matches [check]
Solution
Step 1: Understand role of distributed priority queue
The queue is the source of truth for pending tasks; if unavailable, new tasks cannot be fetched.Step 2: Analyze failure impact
Without the queue, tasks submitted may be lost if not persisted elsewhere; workers cannot fetch tasks, so blocking (B) is unlikely if queue is down; cron scheduler (D) does not reschedule tasks automatically.Step 3: Evaluate silent drops (C)
Without queue durability, tasks may be lost silently if producers cannot enqueue or retries are not implemented.Final Answer:
Option B -> Option BQuick Check:
Queue failure causes silent task loss without retries [check]
Solution
Step 1: Understand Kafka's role in decoupling send and delivery
Kafka buffers messages asynchronously; without it, Chat Server must synchronously contact Bob's server.Step 2: Trace failure without Kafka
If Bob's server is slow or crashes, Alice's send blocks or message is lost with no retry, breaking reliability.Final Answer:
Option C -> Option CQuick Check:
No Kafka -> synchronous send blocks, message loss on Bob's crash [check]
