Practice
Solution
Step 1: Identify real-time ingestion needs
Relational DB with batch updates (A) is too slow for live traffic; polling (C) adds latency and overhead; manual updates (D) are not scalable or real-time.Step 2: Evaluate streaming system suitability
Kafka (B) supports high-throughput, low-latency ingestion and real-time processing, ideal for live traffic updates.Final Answer:
Option A -> Option AQuick Check:
Kafka streams handle high-velocity data ingestion with low latency [check]
Solution
Step 1: Understand Feed Generator error handling
Discarding (A) loses data silently; pausing and retrying (B) blocks the pipeline indefinitely; crashing (D) causes system downtime.Step 2: Dead-letter queue usage
Sending malformed messages to a dead-letter queue (C) isolates bad data for manual or automated inspection without blocking the main pipeline.Final Answer:
Option A -> Option AQuick Check:
Dead-letter queue isolates bad messages without blocking processing [check]
Solution
Step 1: Analyze mobile client constraints
Mobile clients often have intermittent connectivity and limited support for persistent streaming (gRPC streaming in Use gRPC streaming for real-time message delivery to mobile clients is unreliable on mobile). WebSockets without offline caching (Use WebSockets with server push and no offline caching) fail offline support. Polling (Use polling every few seconds to fetch new messages) adds latency and battery drain.Step 2: Evaluate REST with local storage
REST APIs combined with client-side local storage and background sync enable offline message access and eventual consistency with low latency.Final Answer:
Option C -> Option CQuick Check:
REST + local storage -> offline support and sync [check]
Solution
Step 1: Analyze architecture requirements
Low latency and high availability require partitioning to avoid bottlenecks and asynchronous replication to avoid blocking on failover.Step 2: Evaluate options
Use a single centralized matching engine with synchronous replication to a hot standby blocks on synchronous replication causing latency; Use multiple independent matching engines with eventual consistency and conflict resolution risks conflicts and inconsistent order books; Use a cloud-managed database with built-in failover and no dedicated matching engine lacks dedicated matching engine causing latency and complexity.Final Answer:
Option A -> Option AQuick Check:
Partitioned matching engine + async replication -> low latency + availability [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]
