Practice
1. For a global service requiring low latency and high availability, which DNS load balancing approach is best when client IPs are often masked by VPNs or proxies?
medium
Solution
Step 1: Analyze IP masking impact
GeoDNS relying on client IP (A) fails when IPs are masked by VPNs/proxies, causing inaccurate geolocation.Step 2: Evaluate alternatives
Anycast IP routing (B) routes clients to nearest data center at network level, unaffected by IP masking. DNS latency-based routing (C) adds complexity and latency. Centralized DNS (D) is a bottleneck and not scalable.Final Answer:
Option C -> Option CQuick Check:
Anycast routes at network layer, bypassing IP masking issues [check]
Hint: Anycast routes clients despite IP masking, GeoDNS fails [check]
Common Mistakes:
2. You need to model a social media feed with millions of users and high write throughput. Which data modeling approach is best to optimize for write scalability and read performance?
medium
Solution
Step 1: Analyze write scalability and read patterns
High write throughput and millions of users require scalable writes and efficient feed reads.Step 2: Evaluate referencing with denormalization
Referencing separates concerns; denormalizing popular posts into feeds optimizes read performance without large documents.Final Answer:
Option D -> Option DQuick Check:
Referencing plus denormalization balances write scale and read speed [check]
Hint: Reference plus denormalize popular data for scalable writes and fast reads [check]
Common Mistakes:
3. For a high-throughput e-commerce system requiring strong consistency and complex joins, which database choice best balances performance and transactional integrity?
medium
Solution
Step 1: Analyze requirements
Strong consistency and complex joins require relational capabilities and transactional integrity across shards.Step 2: Evaluate options
Sharded relational DB with two-phase commit supports distributed transactions and joins, unlike NoSQL or cache-based approaches.Final Answer:
Option A -> Option AQuick Check:
Sharded RDB + 2PC balances scale and ACID [check]
Hint: Distributed transactions need 2PC, not eventual consistency stores [check]
Common Mistakes:
4. At 10x scale, which component in Spotify's streaming architecture is most likely to fail first and why?
hard
Solution
Step 1: Identify stateful bottlenecks at scale
Streaming servers maintain WebSocket connections which are stateful and tied to server memory.Step 2: Evaluate scaling challenges
Metadata DB (A) can be sharded; CDN caches (B) scale by adding regions; offline manager (D) limited by device, not server scale. Streaming servers (C) face connection limits and resharding complexity.Final Answer:
Option B -> Option BQuick Check:
Stateful WebSocket servers fail first at 10x scale [check]
Hint: Stateful WebSocket servers bottleneck at scale [check]
Common Mistakes:
5. At 10x scale, which component in the SLO error budget tracking system is most likely to become the bottleneck first, and why?
hard
Solution
Step 1: Identify stateful components that limit horizontal scaling
The metrics aggregation service maintains counters and error budget state, which are hard to shard without losing accuracy.Step 2: Evaluate other components' scalability
Dashboards (A) are client-side and less critical; Kafka (C) scales well with partitions; alerting (D) can batch and scale horizontally.Final Answer:
Option A -> Option AQuick Check:
Stateful aggregation -> sharding limits -> bottleneck at scale [check]
Hint: Stateful aggregation limits sharding, causing first bottleneck at scale [OK]
Common Mistakes:
