Practice
Solution
Step 1: Trace quorum coordinator failure after majority ack
Coordinator crashes before responding, client waits but eventually times out.Step 2: Client retries write causing potential duplicates
Client retries due to timeout; duplicates possible if write was committed.Final Answer:
Option A -> Option AQuick Check:
Timeout triggers retry risking duplicate writes [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: Analyze latency and ingestion frequency requirements
High-frequency data with strict latency requires near real-time processing to avoid stale metrics.Step 2: Compare architectures
Batch processing (A) introduces high latency unsuitable for real-time needs. Storing raw data only (C) delays insights and burdens query engines. Relational DBs (D) struggle with high write throughput and time-series data volume. Stream processing (B) supports continuous, low-latency windowed aggregations.Final Answer:
Option A -> Option AQuick Check:
Stream processing enables low-latency, continuous aggregation [check]
Solution
Step 1: Identify stateful bottlenecks at scale
Chat servers hold WebSocket connections in memory, which are stateful and tied to specific servers, limiting horizontal scaling.Step 2: Compare other components
Databases can be sharded; Kafka scales with partitions; presence service caches can be distributed; chat servers' stateful connections are the hardest to shard.Final Answer:
Option A -> Option AQuick Check:
Stateful WebSocket connections -> chat servers bottleneck at 10x scale [check]
Solution
Step 1: Analyze event store scaling constraints
Kafka partitions limit throughput; increasing partitions requires rebalancing, causing temporary unavailability.Step 2: Compare other components
Read model DB can be scaled horizontally; command handler is async; Delivery Worker scales with consumers.Final Answer:
Option A -> Option AQuick Check:
Kafka partition limits and rebalancing -> first bottleneck at 10x scale [check]
