Practice
1. In the request flow of a global load balancing system, at Step 3 the GSLB receives a DNS query for a user in Europe. What does the GSLB do at this step?
easy
Solution
Step 1: Understand GSLB behavior at DNS query
GSLB does not blindly return IPs (Returns the IP of the closest data center without checking health status) or forward queries (Forwards the DNS query to the local data center's DNS server for resolution). It actively checks health and latency to pick the best endpoint.Step 2: Evaluate caching behavior
Indefinite caching (Caches the previous DNS response indefinitely to reduce load) would prevent dynamic failover and load balancing.Final Answer:
Option B -> Option BQuick Check:
GSLB checks health and latency before DNS response [check]
Hint: GSLB checks health before DNS response [check]
Common Mistakes:
2. For a mobile app with limited control over HTTP headers and caching proxies, which API versioning strategy is best to ensure backward compatibility and cache friendliness?
medium
Solution
Step 1: Consider mobile client and caching constraints
Mobile clients and caching proxies often ignore or strip custom headers, making header-based versioning unreliable.Step 2: Evaluate URL versioning benefits
Embedding version in URL ensures cache keys differ per version, enabling backward compatibility and cache friendliness.Final Answer:
Option A -> Option AQuick Check:
URL versioning works best with caching proxies and limited header control [check]
Hint: URL versioning beats headers for caching and mobile clients [check]
Common Mistakes:
3. For a high-throughput TCP service requiring minimal latency and no application-level inspection, which load balancing approach is best?
medium
Solution
Step 1: Identify latency and throughput constraints
Layer 4 load balancers operate at transport layer with minimal overhead, suitable for high throughput and low latency.Step 2: Eliminate options adding unnecessary overhead
Layer 7 load balancers and application proxies inspect payload, increasing latency. DNS round-robin lacks health checks and session affinity.Final Answer:
Option B -> Option BQuick Check:
Layer 4 LB minimizes latency by forwarding packets without payload inspection [check]
Hint: Minimal latency? Choose Layer 4 load balancing [check]
Common Mistakes:
4. At 10x scale, which component in the real-time leaderboard system is most likely to fail first, and why?
hard
Solution
Step 1: Analyze Redis Sorted Sets scaling limits
Sorted Sets require in-memory storage and have limited sharding options, making Redis cluster memory the bottleneck.Step 2: Compare other components
Databases can be scaled horizontally; Ranking Workers can be parallelized; API Gateways scale with load balancers.Step 3: Identify Redis cluster as first failure point
Memory pressure and inability to shard sorted sets efficiently cause Redis cluster to fail first under 10x load.Final Answer:
Option A -> Option AQuick Check:
Redis Sorted Sets memory and sharding limits cause first failure at scale [check]
Hint: Redis Sorted Sets memory limits break first at scale [check]
Common Mistakes:
5. At 10x scale, which component in WhatsApp's architecture is most likely to fail first and why?
hard
Solution
Step 1: Analyze stateful WebSocket connections on Chat Servers
Chat Servers maintain in-memory state per WebSocket; scaling requires connection migration which is complex.Step 2: Compare other components
Databases can shard; Kafka partitions can be increased with rebalancing; presence TTL cache scales horizontally.Final Answer:
Option A -> Option AQuick Check:
Stateful WebSocket connections -> Chat Servers bottleneck at scale [check]
Hint: Stateful WebSocket -> Chat Servers bottleneck at 10x scale [check]
Common Mistakes:
