Practice
1. A web API receives sudden bursts of 10,000 requests per second but must process them at a steady rate of 1,000 requests per second to avoid backend overload. Which component best smooths this traffic to a steady rate without dropping requests?
easy
Solution
Step 1: Identify smoothing mechanism
The leaky bucket algorithm enforces a fixed output rate by draining requests steadily, smoothing bursts.Step 2: Eliminate alternatives
A fixed-size thread pool that rejects excess requests immediately rejects excess requests immediately, not smoothing them. A token bucket that allows bursts up to a maximum token count (token bucket) allows bursts, not smoothing to steady rate. A simple FIFO queue without rate limiting has no rate control, so bursts pass through.Final Answer:
Option A -> Option AQuick Check:
Leaky bucket drains at fixed rate, smoothing bursts [check]
Hint: Leaky bucket smooths bursts by fixed-rate draining [check]
Common Mistakes:
2. If the reverse proxy responsible for SSL termination crashes, what exactly breaks in the request flow?
medium
Solution
Step 1: Understand reverse proxy SSL termination failure
If the reverse proxy crashes, SSL termination stops, so backend servers receive unencrypted traffic if clients connect directly or fallback occurs.Step 2: Eliminate other options
Clients cannot connect directly if proxy is mandatory; SSL handshake fails only if proxy blocks connection; proxy can't forward encrypted requests without decrypting if crashed.Final Answer:
Option C -> Option CQuick Check:
Reverse proxy crash exposes backend to unencrypted traffic [check]
Hint: Reverse proxy crash exposes backend to unencrypted traffic [check]
Common Mistakes:
3. For a system requiring globally unique IDs with high throughput and low latency, which approach is best considering the trade-offs of coordination overhead and ID ordering?
medium
Solution
Step 1: Evaluate coordination overhead
Consensus (A) ensures strong consistency but adds latency and limits throughput; DB auto-increment with sharding (D) risks collisions and complex coordination.Step 2: Assess ordering and uniqueness
UUIDs (C) are unique but unordered and can cause issues in ordered systems; Ticket Server (B) balances uniqueness, ordering, and throughput by allocating ID blocks.Final Answer:
Option C -> Option CQuick Check:
Ticket Server -> high throughput, low latency, ordered IDs [check]
Hint: Centralized block allocation beats consensus and UUIDs for throughput [check]
Common Mistakes:
4. At 10x scale, which component in a strongly consistent distributed database is most likely to fail first, and why?
hard
Solution
Step 1: Identify bottleneck in strong consistency
The consensus leader node handles all write coordination and replication, becoming a bottleneck as scale increases.Step 2: Eliminate other options
Network switches are scalable with proper design; client SDKs scale horizontally; storage engines can be sharded or scaled independently.Final Answer:
Option D -> Option DQuick Check:
Consensus leader node bottlenecks write coordination at scale [check]
Hint: Consensus leader bottlenecks writes at scale [check]
Common Mistakes:
5. At 10x scale, which component in the News Feed system is most likely to fail first and why?
hard
Solution
Step 1: Analyze bottlenecks at 10x scale
Database (A) can be sharded; cache (C) scales horizontally; Kafka (D) can add partitions but has limits.Step 2: Delivery Workers face exponential fan-out growth
Fan-out queues grow with followers; Delivery Workers must push updates to millions more followers, causing processing lag and backlog.Final Answer:
Option B -> Option BQuick Check:
Delivery Workers bottleneck due to fan-out processing load [check]
Hint: Delivery Workers bottleneck on fan-out processing at scale [check]
Common Mistakes:
