Practice
Solution
Step 1: Analyze write latency and consistency needs
Write-Behind buffers writes, reducing write latency but allowing stale reads.Step 2: Eliminate other options
Write-Through adds synchronous latency; Cache Aside and Read-Through write directly to DB, no buffering.Final Answer:
Option A -> Option AQuick Check:
Write-Behind buffers writes for low latency, tolerates stale reads [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: Evaluate batch vs real-time ranking
Batch (A) is too stale for real-time user behavior; heuristic (C) lacks adaptability; client-side (D) cannot access server-side signals securely.Step 2: Online feature store benefits
Online feature stores enable real-time scoring with fresh data and incremental model updates, supporting complex signals and spam detection.Final Answer:
Option D -> Option DQuick Check:
Online feature store supports real-time, complex ranking [check]
Solution
Step 1: Evaluate WebSocket vs gRPC streaming for mobile clients
gRPC streaming is efficient but poorly supported on many mobile platforms; WebSocket is widely supported with heartbeat to detect disconnects.Step 2: Consider fallback mechanisms
WebSocket with push notification fallback handles intermittent connectivity better than long polling or MQTT, which have higher overhead or complexity.Final Answer:
Option B -> Option BQuick Check:
WebSocket + push fallback balances latency and mobile constraints [check]
Solution
Step 1: Understand Kafka topic role
Kafka topic buffers and streams driver location updates to downstream services.Step 2: Trace failure impact
Deleting the topic causes producer writes to fail silently or drop messages; no automatic backup switch; driver apps continue sending but updates are lost; matching service receives stale data but does not block.Final Answer:
Option A -> Option AQuick Check:
Kafka topic deletion causes permanent loss of location updates [check]
