Practice
1. In a Raft consensus system, at Step 4, the Leader sends AppendEntries RPCs to followers. What happens if a follower's log is inconsistent at this step?
easy
Solution
Step 1: Understand Raft's log replication mechanism
If a follower's log is inconsistent with the leader's, it rejects the AppendEntries RPC to signal a mismatch.Step 2: Leader's response to rejection
The leader decrements the nextIndex for that follower and retries AppendEntries until logs match.Final Answer:
Option B -> Option BQuick Check:
Follower rejects inconsistent logs -> leader retries with decremented nextIndex [check]
Hint: Follower rejects mismatched logs; leader retries with lower index [check]
Common Mistakes:
2. A high-throughput messaging system must guarantee no data loss even if consumers are slow or temporarily offline. Which component best ensures durability without blocking producers?
easy
Solution
Step 1: Identify durability guarantees needed
In-memory queues and caches (A, D) risk data loss on crashes; relational DB (C) can block producers due to synchronous commits.Step 2: Evaluate Kafka's role
Kafka provides durable, replicated logs that persist to disk and decouple producers from slow consumers, ensuring no data loss.Final Answer:
Option A -> Option AQuick Check:
Kafka replication and disk persistence ensure durability without blocking [check]
Hint: Durability needs disk + replication, not just memory or sync DB [check]
Common Mistakes:
3. If the OT engine component crashes and loses its in-memory operation buffer before persisting, what is the most likely failure observed by users during collaborative editing?
medium
Solution
Step 1: Identify OT engine's role in buffering and transforming operations
The OT engine buffers concurrent operations in memory to transform and order them before persistence.Step 2: Trace failure impact of OT engine crash losing in-memory buffer
Without the buffer, the engine cannot process new edits correctly, causing the system to block new edits (read-only) until recovery.Final Answer:
Option A -> Option AQuick Check:
OT engine crash causes editing to block (read-only), not silent data loss [check]
Hint: OT engine crash blocks edits; no silent data loss [check]
Common Mistakes:
4. For delivering videos globally with low latency, should the system use a centralized origin server with global CDN caching, or a peer-to-peer (P2P) delivery network? Assume millions of users worldwide and variable network conditions.
medium
Solution
Step 1: Evaluate delivery approaches for global scale and latency
P2P (A) alone is unreliable due to variable user upload bandwidth and NAT traversal issues. Multiple regional origins without CDN (D) add complexity and don't scale well globally. P2P with CDN fallback (C) adds complexity and inconsistent performance.Step 2: Recognize CDN benefits
A centralized origin with global CDN (B) provides consistent availability, low latency via edge caching, and simplifies management, making it the best fit for millions of users worldwide.Final Answer:
Option A -> Option AQuick Check:
Global CDN ensures consistent low-latency delivery [check]
Hint: Global CDN with origin beats P2P for consistent delivery [check]
Common Mistakes:
5. At 10x scale, which component in the blob store architecture is most likely to fail first due to stateful connection limits, and why?
hard
Solution
Step 1: Identify stateful bottleneck at front-end API servers
API servers maintain stateful client sessions (e.g., HTTP keep-alive or TLS), limiting horizontal scaling due to connection affinity.Step 2: Eliminate other options
Storage nodes scale with added disks; metadata service shards metadata; distributed log partitions scale with more brokers.Final Answer:
Option A -> Option AQuick Check:
Stateful client sessions limit API server horizontal scaling [check]
Hint: Stateful API servers limit scaling due to connection affinity [check]
Common Mistakes:
