Practice
1. Without a heartbeat mechanism in client-side service discovery, what exact failure occurs when a service instance crashes?
medium
Solution
Step 1: Understand heartbeat role in client-side discovery
Heartbeats keep registry updated; without them, registry cannot detect crashed instances.Step 2: Trace failure impact
Without heartbeats, registry retains stale instances; clients cache stale data and send requests to dead instances causing failures.Final Answer:
Option A -> Option AQuick Check:
Registry removes crashed instances only if heartbeats present [check]
Hint: No heartbeat -> registry unaware -> stale instances persist [check]
Common Mistakes:
2. At 10x scale, which component in a Kafka-like distributed message queue is most likely to fail first, and why?
hard
Solution
Step 1: Identify bottlenecks at 10x scale
Network switches (A) scale with hardware upgrades; ZooKeeper (C) handles coordination but is lightweight compared to brokers; consumers (D) can be scaled horizontally.Step 2: Kafka broker partition leader overload
Partition leaders handle all writes and replication for their partitions; at 10x scale, leaders become hotspots causing CPU, disk, and network saturation, leading to failures.Final Answer:
Option A -> Option AQuick Check:
Partition leaders overloaded -> broker failure first at scale [check]
Hint: Partition leaders handle all writes -> overload first at scale [check]
Common Mistakes:
3. At 10x scale, which component in a real-time chat system is most likely to fail first due to latency-throughput trade-offs, and why?
hard
Solution
Step 1: Identify stateful bottlenecks
Chat servers maintain WebSocket connections statefully, limiting horizontal scaling.Step 2: Compare other components
Databases (A) can be sharded; brokers (C) can add partitions; load balancers (D) scale horizontally; chat servers (B) fail first due to sticky state and connection limits.Final Answer:
Option D -> Option DQuick Check:
Stateful WebSocket servers limit scaling more than other components [check]
Hint: Stateful WebSocket servers block scaling first at 10x load [check]
Common Mistakes:
4. At 10x scale, which component in a microservices architecture is most likely to become the first bottleneck, and why?
hard
Solution
Step 1: Identify stateful components at risk
Stateful microservices holding WebSocket connections cannot easily shard or move connections, limiting horizontal scaling.Step 2: Compare other components' scaling characteristics
Shared DB and service discovery can be sharded or cached; API Gateway can be scaled horizontally with load balancers.Final Answer:
Option B -> Option BQuick Check:
Stateful WebSocket connections limit microservices horizontal scaling [check]
Hint: Stateful WebSocket limits microservices scaling first [check]
Common Mistakes:
5. At 10x scale, which component in the Redlock system is most likely to fail first and why?
hard
Solution
Step 1: Identify bottleneck at 10x scale
Increased lock requests increase network latency and contention on clients acquiring locks.Step 2: Analyze impact on lock acquisition
Higher latency causes clients to miss lock acquisition timeouts, reducing throughput and increasing retries.Step 3: Compare other components
Redis masters scale better with sharding; network links and timers less likely first failure.Final Answer:
Option D -> Option DQuick Check:
Clients hit network latency -> lock timeouts -> first failure at scale [check]
Hint: Clients face latency -> lock timeouts -> first failure at scale [check]
Common Mistakes:
