Practice
1. In a distributed database, at Step 4 the coordinator node receives conflicting writes from two partitions during a network split. What state does the coordinator enter immediately after Step 4?
easy
Solution
Step 1: Trace coordinator behavior at Step 4
The coordinator detects conflicting writes from partitions and cannot commit both safely.Step 2: Understand conflict resolution
It marks writes as conflicting and delays commit until partitions heal to avoid inconsistency.Final Answer:
Option A -> Option AQuick Check:
Coordinator defers conflicting writes until partition resolution [check]
Hint: Coordinator delays conflicting writes until partition heals [check]
Common Mistakes:
2. A real-time leaderboard system must handle millions of score updates per second with low latency and provide instant rank queries. Which component is best suited to store and update scores efficiently while maintaining sorted order?
easy
Solution
Step 1: Identify data structure for sorted order and fast updates
Redis Sorted Sets provide O(log N) insertion and rank queries with in-memory speed, ideal for real-time leaderboards.Step 2: Eliminate other options based on latency and ordering
Relational DBs have higher write latency and complex locking; Kafka stores events but doesn't maintain sorted order; MongoDB lacks efficient sorted queries at scale.Final Answer:
Option D -> Option DQuick Check:
Redis Sorted Sets maintain sorted scores with low latency [check]
Hint: Sorted Sets keep scores sorted with fast rank queries [check]
Common Mistakes:
3. A distributed system needs to generate unique IDs for millions of events per second without coordination delays. Which component is best suited to generate these IDs efficiently?
easy
Solution
Step 1: Identify coordination bottlenecks in centralized DB
Auto-increment keys require coordination, causing latency and contention at high scale.Step 2: Evaluate decentralized timestamp-based ID generators
Snowflake-style IDs combine timestamp and node ID, enabling scalable, ordered unique IDs without coordination.Final Answer:
Option A -> Option AQuick Check:
Decentralized timestamp + node ID -> scalable unique ID generation [check]
Hint: Decentralized timestamp + node ID avoids coordination delays [check]
Common Mistakes:
4. At 10x scale, which component in a consistent hashing system with virtual nodes is most likely to fail first and why?
hard
Solution
Step 1: Identify scaling bottlenecks
Physical nodes scale horizontally; network and hash function scale well with optimizations.Step 2: Analyze token metadata service
Managing many virtual nodes and frequent node changes increases metadata complexity and update frequency, causing bottlenecks.Final Answer:
Option B -> Option BQuick Check:
Token metadata service complexity grows fastest, causing first failure [check]
Hint: Token metadata complexity grows fastest at scale [check]
Common Mistakes:
5. At 10x scale, which component in a time-series database system is most likely to fail first and why?
hard
Solution
Step 1: Identify bottlenecks at 10x scale
High write volume increases partition count and complexity of partition coordination.Step 2: Evaluate component scalability
Query engine (A) slows but can be scaled horizontally. Storage nodes (C) face I/O limits but can add disks. Metadata service (D) scales better with caching. Partition coordinator (B) faces coordination overhead and metadata contention, causing first failure.Final Answer:
Option C -> Option CQuick Check:
Partition coordinator overhead grows fastest at scale [check]
Hint: Partition coordination overhead grows fastest at scale [check]
Common Mistakes:
