Practice
1. A blob storage system must handle millions of small object writes per second with low latency and guarantee durability. Which component is primarily responsible for decoupling the high write throughput from the slower disk persistence layer?
easy
Solution
Step 1: Identify the role of the distributed log
The distributed write-ahead log buffers incoming writes asynchronously, decoupling high write throughput from slower disk persistence.Step 2: Eliminate other options
Relational DBs synchronously block writes, CDN caches are read-optimized not write buffers, and a single master node creates a bottleneck.Final Answer:
Option D -> Option DQuick Check:
Distributed log buffers writes asynchronously for durability and throughput [check]
Hint: Distributed log buffers writes before disk persistence [check]
Common Mistakes:
2. In the vector database request flow, at Step 4 the ANN Search Worker queries the HNSW index with a new vector. What state does the worker observe if the index is currently rebuilding due to a recent bulk insert?
easy
Solution
Step 1: Understand HNSW index rebuild behavior
HNSW index rebuilds asynchronously; during rebuild, queries use the last consistent snapshot.Step 2: Analyze worker behavior at Step 4
The ANN Search Worker returns results from the previous stable index snapshot, so stale but consistent results are served.Final Answer:
Option A -> Option AQuick Check:
HNSW queries serve last snapshot during rebuild, avoiding blocking [check]
Hint: HNSW queries serve last snapshot during rebuild, no blocking [check]
Common Mistakes:
3. In a relational database transaction flow, at Step 4 the transaction manager checks the lock table before committing. What happens if the lock is held by another transaction at this step?
easy
Solution
Step 1: Understand lock table role at Step 4
The transaction manager uses the lock table to ensure no conflicting writes before commit.Step 2: Behavior on lock contention
If the lock is held, the transaction manager blocks to maintain serializability, waiting or timing out rather than aborting immediately or skipping checks.Final Answer:
Option B -> Option BQuick Check:
Lock contention causes blocking until release or timeout [check]
Hint: Lock held -> transaction blocks, no skipping or immediate abort [check]
Common Mistakes:
4. For a system requiring strict consistency on command handling but eventual consistency on query side, which architecture best fits?
medium
Solution
Step 1: Understand consistency requirements
Strict consistency on commands requires immediate validation; eventual consistency on queries allows asynchronous updates.Step 2: Evaluate architectures
CQRS with event sourcing separates command and query models, enabling strict command consistency and eventual query consistency.Final Answer:
Option A -> Option AQuick Check:
CQRS + event sourcing -> strict command, eventual query consistency [check]
Hint: CQRS splits command and query for tailored consistency [check]
Common Mistakes:
5. At 10x scale, which component of a B-Tree index is most likely to become the bottleneck first, and why?
hard
Solution
Step 1: Understand B-Tree root node role
All searches start at the root node, which must be accessed for every lookup, making it a hotspot under high concurrency.Step 2: Analyze scaling impact
At 10x scale, root node contention increases as many threads compete to read/update it, limiting throughput before leaf or internal nodes become bottlenecks.Final Answer:
Option B -> Option BQuick Check:
Root node hotspot causes contention first at scale [check]
Hint: Root node is single entry point, hotspot at scale [check]
Common Mistakes:
