Practice
1. A distributed key-value store must remain operational during network partitions but can tolerate stale reads temporarily. Which system design choice best supports this requirement?
easy
Solution
Step 1: Identify CAP constraints
During network partitions, a system must choose between consistency and availability.Step 2: Match system behavior
AP systems prioritize availability and partition tolerance, allowing stale reads but remaining operational.Final Answer:
Option D -> Option DQuick Check:
AP systems allow availability during partitions with eventual consistency [check]
Hint: AP favors availability over consistency during partitions [check]
Common Mistakes:
2. In a distributed file system request flow, at Step 4 the Metadata Server responds to the client with block locations. What state does the client hold immediately after Step 4?
easy
Solution
Step 1: Trace Step 4 response
At Step 4, Metadata Server returns block locations (metadata) to the client; client does not yet have file data.Step 2: Confirm client state
Client holds metadata (block locations) but must contact Data Nodes separately to read/write data blocks.Final Answer:
Option B -> Option BQuick Check:
Client holds metadata, not data, immediately after Step 4 [check]
Hint: Client gets block locations before contacting Data Nodes [check]
Common Mistakes:
3. In a system generating IDs using a custom ID service, at step 3 the ID generator assigns a timestamp-based prefix before appending a sequence number. What happens if the sequence number reaches its max value before the timestamp changes?
easy
Solution
Step 1: Trace ID generation at step 3
The timestamp prefix combined with a sequence number ensures uniqueness within the same timestamp.Step 2: Understand sequence number overflow handling
When the sequence number maxes out, the generator must wait for the timestamp to increment to avoid duplicates, thus blocking new ID generation temporarily.Final Answer:
Option B -> Option BQuick Check:
Sequence overflow -> block until timestamp changes [check]
Hint: Sequence maxed -> wait for timestamp tick [check]
Common Mistakes:
4. For timeline generation at scale, which architecture better handles users with millions of followers and why?
medium
Solution
Step 1: Analyze push vs pull trade-offs
Push fan-out is efficient for low-follower users but expensive for celebrities; pull is costly on read latency.Step 2: Evaluate hybrid approach
Hybrid uses push for most users, pull for celebrities, balancing latency and write amplification.Step 3: Eliminate other options
Pure push (A) causes huge write amplification; pure pull (C) causes high read latency; global sorted set (D) is hard to scale and update asynchronously.Final Answer:
Option C -> Option CQuick Check:
Hybrid push-pull balances write cost and read latency [check]
Hint: Hybrid push-pull fits follower count extremes [check]
Common Mistakes:
5. At 10x scale, which component is most likely to become the bottleneck first in the LLM-powered support bot, and why?
hard
Solution
Step 1: Identify scaling challenges for each component
Human agents (A) scale linearly but can be increased with hiring. Message queue (C) scales well horizontally. Database (D) can be sharded.Step 2: Analyze Intent Classifier bottleneck
Synchronous LLM inference is compute-intensive and latency-sensitive, causing concurrency limits and queuing delays at 10x load.Step 3: Confirm first failure point
Intent Classifier service hits CPU/GPU resource limits first, blocking downstream components.Final Answer:
Option A -> Option AQuick Check:
Synchronous LLM inference latency limits concurrency first [check]
Hint: LLM inference latency blocks concurrency at scale [check]
Common Mistakes:
