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 the request flow of the leaderboard system, at step 4 the Ranking Worker reads the updated score from Redis Sorted Sets. What state does the Ranking Worker observe if the score update was just written but the TTL expired simultaneously?
easy
Solution
Step 1: Understand Redis TTL eviction behavior
Redis removes keys immediately after TTL expiration, so if TTL expired, the score entry is deleted.Step 2: Trace Ranking Worker read at step 4
Ranking Worker reads Redis Sorted Set; if key expired, it finds no entry, not stale or partial data.Final Answer:
Option A -> Option AQuick Check:
Redis TTL expiry deletes keys before read, so no score entry found [check]
Hint: TTL expiry deletes keys before reads, no stale data returned [check]
Common Mistakes:
3. For a high-throughput system where write latency must be minimized and occasional stale reads are acceptable, which caching pattern is the best choice?
medium
Solution
Step 1: Analyze write latency and consistency needs
Write-Behind buffers writes, reducing write latency but allowing stale reads.Step 2: Eliminate other options
Write-Through adds synchronous latency; Cache Aside and Read-Through write directly to DB, no buffering.Final Answer:
Option A -> Option AQuick Check:
Write-Behind buffers writes for low latency, tolerates stale reads [check]
Hint: Write-Behind buffers writes, reduces latency, allows stale reads [check]
Common Mistakes:
4. You need to design an Elasticsearch cluster optimized for low-latency search queries on a read-heavy workload with occasional node failures. Which architecture choice best balances query speed and fault tolerance?
medium
Solution
Step 1: Evaluate shard size and replication
Multiple smaller shards allow parallel query execution; replicas provide fault tolerance and load balancing.Step 2: Eliminate other options
Single large shard causes query bottleneck; disabling replicas risks data loss and no failover; using only replicas offline is invalid as primaries handle writes.Final Answer:
Option A -> Option AQuick Check:
Multiple shards + replicas balance speed and fault tolerance [check]
Hint: Multiple shards + replicas optimize read speed and fault tolerance [check]
Common Mistakes:
5. At 10x scale, which observability component is most likely to fail first and why?
hard
Solution
Step 1: Analyze scaling characteristics of observability components
Tracing volume grows exponentially with request fan-out, causing storage and query bottlenecks.Step 2: Compare with other components
Logging scales linearly; metrics systems shard well; alerting scales with metrics, so less likely first failure.Final Answer:
Option C -> Option CQuick Check:
Tracing volume explosion -> backend overwhelmed first [check]
Hint: Tracing volume explodes with fan-out, stressing backend first [check]
Common Mistakes:
