Practice
1. In a primary-replica replication system, at step 4 the replica receives a batch of write-ahead log entries from the primary. What is the replica's exact state after applying these entries?
easy
Solution
Step 1: Trace replica behavior at step 4
Replica applies WAL entries to its local store to catch up with primary.Step 2: Understand acknowledgment timing
Replica acknowledges primary only after applying entries to ensure durability and consistency.Final Answer:
Option B -> Option BQuick Check:
Replica applies then acknowledges -> ensures data durability [check]
Hint: Apply WAL entries before ack -> durability ensured [check]
Common Mistakes:
2. A distributed API rate limiter must enforce limits with minimal latency at the network edge. Which component is best suited to perform this enforcement?
easy
Solution
Step 1: Identify edge enforcement needs
Enforcement must be low-latency and close to the client to avoid network round trips.Step 2: Evaluate options for latency and consistency
Centralized DB (A) adds latency; batch jobs (C) are too delayed; client SDK (D) is untrustworthy. Edge cache with local counters (B) balances latency and eventual consistency.Final Answer:
Option B -> Option BQuick Check:
Edge cache enforces limits locally with periodic sync [check]
Hint: Enforce limits close to client with local counters [check]
Common Mistakes:
3. A full-text search system must handle millions of document updates per second and ensure near real-time search availability. Which component is best suited to buffer and decouple the high write throughput from the indexing process?
easy
Solution
Step 1: Identify buffering component for high write throughput
Relational DBs with triggers (A) are not designed for millions of writes per second and cause blocking. Redis (C) is fast but storing entire inverted index in memory is not durable or scalable. Message queues without ordering (D) risk out-of-order updates causing index inconsistency.Step 2: Evaluate Kafka's suitability
Kafka provides durable, ordered, partitioned logs that can buffer high write rates and decouple ingestion from indexing, enabling near real-time processing.Final Answer:
Option B -> Option BQuick Check:
Kafka buffers high write throughput with ordering and durability [check]
Hint: Kafka buffers writes with ordering and durability [check]
Common Mistakes:
4. If the commit metadata database becomes unavailable, what is the immediate failure observed when a user tries to create a new branch?
medium
Solution
Step 1: Understand role of commit metadata DB
Commit metadata DB stores branch pointers; without it, server cannot persist new branches.Step 2: Trace branch creation failure
Client may create branch locally, but server cannot persist it, so branch is effectively lost or inconsistent.Step 3: Eliminate other options
Queuing without notification hides failure; immediate error is possible but not typical if client allows local ops; marking unverified branches requires metadata DB access.Final Answer:
Option D -> Option DQuick Check:
Metadata DB down -> branch created locally but not persisted [check]
Hint: Metadata DB down -> local branch only, no server persistence [check]
Common Mistakes:
5. If the centralized session store is unavailable, what exactly breaks in a system where stateless frontends rely on it for user session data?
medium
Solution
Step 1: Identify session store role
Centralized session store provides authentication and session state to stateless frontends.Step 2: Trace failure impact
If unavailable, frontends cannot validate sessions, leading to silent session expiry and unauthenticated request processing.Final Answer:
Option C -> Option CQuick Check:
Session store down -> sessions expire silently, requests proceed unauthenticated [check]
Hint: Session store down -> silent expiry, unauthenticated requests proceed [check]
Common Mistakes:
