Practice
1. A web API must limit incoming requests to 100 per second with bursts allowed up to 200 requests. Which component best enforces this rate limiting with burst handling?
easy
Solution
Step 1: Identify rate limiting with burst support
The token bucket algorithm allows tokens to accumulate up to a max bucket size, enabling bursts beyond the steady refill rate.Step 2: Eliminate other options
Fixed window counters cause spikes at window boundaries and don't handle bursts well. Leaky bucket smooths traffic but disallows bursts. Simple queues drop excess requests without rate control.Final Answer:
Option D -> Option DQuick Check:
Token bucket allows bursts by token accumulation [check]
Hint: Token bucket = steady refill + burst capacity [OK]
Common Mistakes:
2. For storing user and item embeddings in a recommendation system, which storage choice best balances low-latency reads and frequent updates at scale?
medium
Solution
Step 1: Identify storage requirements
Embedding storage requires low-latency reads and frequent writes at scale with high availability.Step 2: Evaluate storage options
Relational DB (A) struggles with write throughput and scaling; Cassandra (B) offers tunable consistency but may add complexity; file system batch loading (D) introduces stale data and high latency. Document store (C) supports flexible schema and fast reads with embedded documents, balancing latency and update frequency.Final Answer:
Option A -> Option AQuick Check:
Document store balances flexible schema and read/write latency [check]
Hint: Document store balances schema flexibility and latency [check]
Common Mistakes:
3. Without the shard-level cache in the faceted search system, what exactly breaks during high query load spikes?
medium
Solution
Step 1: Understand shard-level cache role
The cache reduces load on shard nodes by serving frequent queries quickly, preventing overload during spikes.Step 2: Trace failure without cache
Without cache, all queries hit shard nodes directly, causing CPU and I/O overload, increasing latency and timeouts.Final Answer:
Option B -> Option BQuick Check:
Cache absence -> shard overload -> latency spikes [check]
Hint: No cache -> shard overload -> latency spikes [check]
Common Mistakes:
4. For a video streaming service with users worldwide, which architecture better reduces origin server load and latency under heavy traffic?
medium
Solution
Step 1: Evaluate origin scaling and latency challenges
Auto-scaling origin servers reduce load but cannot eliminate latency for distant users.Step 2: Assess CDN edge caching benefits
CDN caches content near users, drastically reducing latency and origin load under heavy traffic.Final Answer:
Option A -> Option AQuick Check:
CDN edge caching best reduces latency and origin load globally [check]
Hint: CDN edge caching beats origin scaling for global latency [OK]
Common Mistakes:
5. At 10x scale, which component in a push-based metrics collection system is most likely to fail first, and why?
hard
Solution
Step 1: Analyze storage backend scaling
Storage can be scaled horizontally with sharding; unlikely first failure.Step 2: Analyze Kafka cluster scaling
Kafka scales with partitions but requires careful tuning; not first failure at 10x.Step 3: Analyze aggregation workers
Aggregation workers scale horizontally; CPU load manageable with more instances.Step 4: Analyze metric agents
Agents push metrics frequently, increasing network usage exponentially; network bandwidth at agents is limited and saturates first.Final Answer:
Option D -> Option DQuick Check:
Agents saturate network bandwidth first at 10x scale [check]
Hint: Agents saturate network bandwidth before backend bottlenecks [check]
Common Mistakes:
