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 system needs to serve AI code completions with sub-100ms latency while ensuring up-to-date code context. Which component is best suited to provide fast, low-latency retrieval of relevant code snippets?
easy
Solution
Step 1: Identify low-latency retrieval need
Relational DBs (A) have high query latency for vector similarity; distributed file systems (C) are for storage, not fast retrieval; message queues (D) buffer requests but don't serve retrieval.Step 2: Recognize vector search role
ANN-based in-memory vector search engines (B) provide fast approximate nearest neighbor lookups, ideal for sub-100ms latency code snippet retrieval.Final Answer:
Option B -> Option BQuick Check:
ANN vector search enables fast similarity queries [check]
Hint: Vector search engines excel at fast similarity retrieval [check]
Common Mistakes:
3. A file synchronization system must efficiently detect and upload only changed parts of large files to minimize bandwidth. Which component is primarily responsible for identifying these changed chunks before upload?
easy
Solution
Step 1: Identify chunking responsibility
The client-side chunking module splits files into chunks and computes hashes to detect which chunks have changed, enabling delta uploads.Step 2: Eliminate other components
The server-side storage engine stores chunks but does not perform delta detection; network layer compresses data but doesn't detect changes; metadata DB manages permissions, unrelated to chunk detection.Final Answer:
Option B -> Option BQuick Check:
Client chunking detects changed parts before upload [check]
Hint: Client chunking hashes detect changes before upload [check]
Common Mistakes:
4. Without a distributed lock service, what exactly breaks when two instances concurrently update a shared configuration in a distributed system?
medium
Solution
Step 1: Understand lack of distributed locking
Without distributed locks, concurrent updates can overwrite each other silently (B), causing inconsistent state.Step 2: Evaluate other options
System does not automatically queue updates (C) without explicit coordination. Database rejecting conflicting transactions (D) depends on isolation level and may not prevent lost updates. System crash (A) is unrelated.Final Answer:
Option C -> Option CQuick Check:
Concurrent updates without locks -> silent overwrite [check]
Hint: No lock -> silent overwrite, no automatic queuing [check]
Common Mistakes:
5. 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:
