Practice
1. A global video streaming service needs to reduce latency for users worldwide by caching content close to them. Which CDN component primarily handles this latency reduction?
easy
Solution
Step 1: Identify latency reduction mechanism
Latency is reduced by caching content closer to users, which is done by edge nodes in PoPs.Step 2: Eliminate other components
Origin servers hold master content but are far from users; load balancers and DNS do not cache content.Final Answer:
Option D -> Option DQuick Check:
Edge nodes cache content near users -> latency reduced [check]
Hint: Edge nodes cache near users for low latency [check]
Common Mistakes:
2. A distributed key-value store must evenly distribute keys across nodes and handle node failures without massive data reshuffling. Which component primarily enables this?
easy
Solution
Step 1: Identify the role of consistent hashing
Consistent hashing distributes keys to nodes such that when nodes join or leave, only a small subset of keys need reassignment, minimizing reshuffling.Step 2: Eliminate other components
Vector clocks handle version conflicts but do not distribute keys. Gossip protocol manages cluster membership but not key distribution. Quorum replication ensures durability but does not affect key assignment.Final Answer:
Option C -> Option CQuick Check:
Consistent hashing minimizes key remapping on node changes [check]
Hint: Consistent hashing minimizes key remapping on node changes [OK]
Common Mistakes:
3. For a social network with users having highly variable follower counts (from tens to millions), which fan-out architecture best balances write latency and read latency?
medium
Solution
Step 1: Analyze pure push fan-out (A)
Push to all followers synchronously causes huge write amplification for celebrities, increasing write latency and storage.Step 2: Analyze pure pull fan-out (C)
Pull reduces write cost but increases read latency and complexity for users with many followers.Step 3: Evaluate hybrid fan-out (B)
Hybrid pushes to users with many followers (to reduce read latency) and pulls for users with few followers (to reduce write amplification), balancing both latencies.Step 4: Evaluate push only for active users (D)
Activity-based push doesn't address follower count skew effectively.Final Answer:
Option C -> Option CQuick Check:
Hybrid fan-out balances write and read latency by follower count [check]
Hint: Hybrid fan-out balances write/read latency by follower count [check]
Common Mistakes:
4. For a mobile chat app requiring exactly-once message delivery with minimal latency, which architecture is best suited?
medium
Solution
Step 1: Evaluate Kafka transactions for mobile clients
Kafka's transactional exactly-once requires stable connections and complex coordination, unsuitable for mobile clients with intermittent connectivity.Step 2: Assess idempotent consumers with client deduplication
Idempotent consumers combined with client-side deduplication handle retries and duplicates gracefully, fitting mobile constraints and ensuring exactly-once delivery.Final Answer:
Option D -> Option DQuick Check:
Idempotency + client deduplication -> practical exactly-once for mobile [check]
Hint: Mobile needs idempotency + deduplication, not Kafka transactions [OK]
Common Mistakes:
5. At 10x scale, which component in a bulkhead-isolated microservices system is most likely to fail first, and why?
hard
Solution
Step 1: Analyze scaling impact on components
Shared database (A) is a bottleneck but bulkheads isolate failures before database overload. Load balancer (C) scales horizontally. Network (D) overhead increases but is less immediate.Step 2: Identify bulkhead thread pool limits
Bulkhead thread pools have fixed sizes; at 10x load, they saturate first, causing request rejections and failure to scale.Final Answer:
Option B -> Option BQuick Check:
Bulkhead thread pools saturate first due to fixed resource limits [check]
Hint: Fixed bulkhead pools saturate first at scale [check]
Common Mistakes:
