Practice
1. A critical database cluster must failover automatically without data loss or downtime during a primary node crash. Which component is responsible for orchestrating this failover in a distributed SQL database system?
easy
Solution
Step 1: Identify failover orchestration component
The consensus protocol like Raft manages leader election and ensures log replication consistency, enabling automatic failover without data loss.Step 2: Eliminate other options
Client-side retries (A) handle reconnection but don't orchestrate failover; load balancers (B) redirect traffic but don't manage state; backups (D) aid recovery but not live failover.Final Answer:
Option A -> Option AQuick Check:
Consensus protocol controls leader election and failover [check]
Hint: Consensus protocols manage failover, not clients or load balancers
Common Mistakes:
2. In a system generating KSUIDs, at step 4 the ID generator component appends a random payload after the timestamp. What is the state of the generated ID at this step?
easy
Solution
Step 1: Understand KSUID structure at step 4
KSUIDs combine a 4-byte timestamp prefix with a 16-byte random payload to ensure uniqueness and sortability.Step 2: Eliminate incorrect states
Deterministic timestamp only (A) lacks uniqueness; UUIDv4 (C) is unrelated; sequential number (D) is not part of KSUID design.Final Answer:
Option C -> Option CQuick Check:
KSUID = timestamp + random payload for uniqueness and sortability [check]
Hint: KSUID = timestamp prefix + random payload [check]
Common Mistakes:
3. You need to implement a live news feed with many clients receiving frequent updates but no client-to-server messages. Which technology is best considering scalability and simplicity?
medium
Solution
Step 1: Analyze communication pattern
Live news feed requires unidirectional server-to-client updates with many clients and no client messages.Step 2: Evaluate technology trade-offs
Server-Sent Events efficiently support unidirectional streaming with automatic reconnection and lower overhead than WebSockets. WebSockets add complexity and resource usage for no client-to-server messages. Long Polling is less efficient due to repeated HTTP requests. HTTP/2 server push is not widely supported for this use case.Final Answer:
Option B -> Option BQuick Check:
Server-Sent Events optimize unidirectional streaming with scalability [check]
Hint: Unidirectional + many clients -> Server-Sent Events [check]
Common Mistakes:
4. At 10x scale, which component in a WebRTC video calling system is most likely to become the bottleneck first, and why?
hard
Solution
Step 1: Analyze component scalability at 10x load
Media Servers scale with CPU but can be horizontally scaled; STUN/TURN scale well with stateless UDP; clients are outside system control.Step 2: Identify Signaling Server bottleneck
Signaling Servers hold stateful WebSocket connections per user, making sharding and scaling challenging.Final Answer:
Option B -> Option BQuick Check:
Stateful WebSocket connections limit Signaling Server horizontal scaling [check]
Hint: Stateful WebSocket limits Signaling Server scaling first [check]
Common Mistakes:
5. At 10x scale of global traffic, which component in the BGP-based routing infrastructure is most likely to fail first, and why?
hard
Solution
Step 1: Identify bottleneck at scale
Edge routers handle packet forwarding at line rate; at 10x traffic, their CPU and forwarding ASICs are stressed first.Step 2: Evaluate other components
Route reflectors (A) scale better with hierarchical design; monitoring systems (C) can be scaled horizontally; client devices (D) are downstream and less critical for routing stability.Final Answer:
Option A -> Option AQuick Check:
Edge routers' CPU overload causes first failure at 10x traffic [check]
Hint: Edge routers hit CPU limits first at massive scale [check]
Common Mistakes:
