Practice
Solution
Step 1: Understand Kafka offset commit semantics
Kafka commits offsets only after successful acknowledgment to avoid message loss.Step 2: Delivery Worker behavior on missing ack
If no ack is received, the worker retries delivery to ensure at-least-once semantics; it does not commit offset or discard messages.Final Answer:
Option A -> Option AQuick Check:
Retries without committing offset -> ensures message redelivery [check]
Solution
Step 1: Evaluate persistent connection approaches
gRPC streaming (A) is unreliable on mobile due to network changes and battery constraints; long polling (C) wastes battery and bandwidth.Step 2: Consider platform push services and SMS
Push services (B) handle retries and offline buffering efficiently; SMS (D) is costly and not suitable for all notifications.Final Answer:
Option A -> Option AQuick Check:
Platform push services manage retries and offline buffering [check]
Solution
Step 1: Identify requirements
Playlists require offline edits and eventual sync with conflict resolution.Step 2: Evaluate architectures
Relational DB (A) blocks offline edits; centralized NoSQL (C) lacks offline sync; local-only (D) risks data loss and complex merges. CRDTs (B) enable conflict-free merges and offline edits.Final Answer:
Option A -> Option AQuick Check:
CRDTs enable offline edits with automatic conflict resolution [check]
Solution
Step 1: Identify Kafka's role
Kafka buffers logs between producers and processors, enabling decoupling.Step 2: Trace failure impact
If Kafka is down, producers may retry or block, but processors cannot consume new logs, halting enrichment.Final Answer:
Option B -> Option BQuick Check:
Kafka down -> processors stall on new logs, old logs processed [check]
Solution
Step 1: Analyze scaling impact on components
Write volume and event propagation increase 10x, stressing the event queue.Step 2: Compare bottlenecks
Primary DB writes scale with writes, not reads; read replicas scale horizontally; client caches don't cause exponential invalidation.Final Answer:
Option A -> Option AQuick Check:
Event queue overwhelmed first due to write event surge [check]
