Practice
Solution
Step 1: Identify driver assignment requirements
Real-time, low-latency matching requires fast spatial queries and event-driven updates.Step 2: Evaluate component suitability
Relational DBs with spatial indexes (A) are too slow for high write/read concurrency; batch jobs (C) introduce unacceptable delay; client-side filtering (D) is inefficient and inconsistent.Final Answer:
Option D -> Option DQuick Check:
Distributed in-memory geospatial index with pub/sub -> real-time, scalable driver assignment [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: Understand key distribution and remapping
Modulo-based hashing (A simple modulo-based hash function assigning keys to servers by key % server_count) causes massive remapping when server count changes, violating minimal reshuffling.Step 2: Evaluate consistent hashing with virtual nodes
Consistent hashing with virtual nodes (A consistent hashing ring with virtual nodes to balance load and reduce remapping) evenly distributes keys and minimizes remapping on node changes.Final Answer:
Option C -> Option CQuick Check:
Virtual nodes in consistent hashing minimize key remapping on node changes [check]
Solution
Step 1: Identify multi-region write and availability requirements
Multi-region writes require conflict resolution and high availability without synchronous blocking.Step 2: Compare Redis and DynamoDB capabilities
DynamoDB Global Tables support multi-region writes with built-in conflict resolution and eventual consistency; Redis lacks native multi-region write support.Final Answer:
Option A -> Option AQuick Check:
DynamoDB Global Tables -> multi-region writes with conflict resolution [check]
Solution
Step 1: Identify bottlenecks at 10x scale
Network switches (A) scale with hardware upgrades; ZooKeeper (C) handles coordination but is lightweight compared to brokers; consumers (D) can be scaled horizontally.Step 2: Kafka broker partition leader overload
Partition leaders handle all writes and replication for their partitions; at 10x scale, leaders become hotspots causing CPU, disk, and network saturation, leading to failures.Final Answer:
Option A -> Option AQuick Check:
Partition leaders overloaded -> broker failure first at scale [check]
