Practice
1. A high-traffic e-commerce platform expects sudden spikes of 1 million orders per minute. Which component best handles decoupling order intake from downstream inventory updates to maintain responsiveness?
easy
Solution
Step 1: Identify decoupling need
Immediate consistency via relational DB (A relational database with strong ACID transactions for immediate consistency) blocks on writes, causing latency spikes. In-memory cache (An in-memory cache with TTL eviction to buffer incoming orders) lacks durability and ordering guarantees. API gateway throttling (A REST API gateway that throttles requests to downstream services) limits throughput but doesn't decouple processing.Step 2: Durable queue with partitioning
A distributed message queue (A distributed message queue with partitioning and durable storage) buffers spikes, partitions workload, and guarantees durability, enabling asynchronous downstream processing.Final Answer:
Option C -> Option CQuick Check:
Distributed queue partitions spikes, ensures durability, decouples processing [check]
Hint: Use durable queues to buffer spikes and decouple processing [OK]
Common Mistakes:
2. A distributed system requires generating unique IDs that are sortable by creation time and can be generated independently on multiple nodes without coordination. Which component or technology best fits this requirement?
easy
Solution
Step 1: Identify requirements for sortable, distributed unique IDs
Centralized DB auto-increment (A) is a bottleneck and not distributed; UUIDv4 (C) is unique but not sortable; timestamp+node ID without collision prevention (D) risks duplicates.Step 2: Recognize ULID/KSUID properties
ULID and KSUID provide time-sortable, collision-resistant IDs generated independently on nodes.Final Answer:
Option A -> Option AQuick Check:
ULID/KSUID generate sortable unique IDs without coordination [check]
Hint: Sortable unique IDs without coordination -> ULID/KSUID [check]
Common Mistakes:
3. A distributed cache system needs to minimize data reshuffling when nodes are added or removed. Which hashing strategy best supports this requirement?
easy
Solution
Step 1: Identify modular hashing limitations
Modular hashing requires rehashing all keys when node count changes, causing massive reshuffling.Step 2: Understand consistent hashing benefits
Consistent hashing maps nodes and keys on a ring, minimizing key movement to only neighbors when nodes change.Final Answer:
Option A -> Option AQuick Check:
Consistent hashing minimizes reshuffling on node changes [check]
Hint: Consistent hashing minimizes reshuffle on node changes [check]
Common Mistakes:
4. During a global network outage caused by BGP misconfiguration, which recovery approach balances speed and safety best for restoring connectivity without causing routing loops?
medium
Solution
Step 1: Understand recovery trade-offs
Immediate re-advertisement (A) risks routing loops and instability; static routes (C) don't scale globally; client retries (D) don't fix routing issues.Step 2: Evaluate gradual reintroduction
Route flap damping (B) prevents rapid route changes causing instability, balancing speed and safety during recovery.Final Answer:
Option A -> Option AQuick Check:
Route flap damping prevents loops during gradual route restoration [check]
Hint: Gradual route reintroduction with damping avoids loops [check]
Common Mistakes:
5. At 10x scale, which component in a multi-tier storage system is most likely to become the bottleneck first, and why?
hard
Solution
Step 1: Identify component roles at scale
Archive storage uses tape drives with limited concurrent access bandwidth and high latency.Step 2: Analyze scaling challenges
At 10x scale, tape drives become bottleneck due to limited parallelism and slow seek times, unlike metadata which can be sharded.Final Answer:
Option A -> Option AQuick Check:
Archive tape bandwidth limits -> first bottleneck [check]
Hint: Tape archive bandwidth limits scale poorly [check]
Common Mistakes:
