Practice
1. A system must handle 1 million writes per second and fan-out to millions of users asynchronously. Which component best handles decoupling write load from delivery?
easy
Solution
Step 1: Identify the need for decoupling writes from fan-out
Handling 1 million writes per second with synchronous fan-out is not feasible on a single machine or direct calls.Step 2: Evaluate components for asynchronous buffering
Kafka provides durable, partitioned logs that buffer writes and allow scalable asynchronous delivery. Relational DBs can't handle this write load synchronously. Redis lacks durability guarantees for this scale. Direct HTTP calls block and don't scale.Final Answer:
Option D -> Option DQuick Check:
Kafka buffers writes asynchronously, enabling high write throughput [check]
Hint: Use durable queues to decouple high write load [check]
Common Mistakes:
2. For delivering real-time location updates to mobile clients, which approach is better considering intermittent mobile network connectivity and battery constraints?
medium
Solution
Step 1: Evaluate persistent connection options
gRPC streaming is efficient but less supported on mobile platforms and can drain battery.Step 2: Compare WebSocket and polling
WebSocket supports bidirectional communication with reconnection and heartbeats, balancing real-time and battery use better than polling.Final Answer:
Option A -> Option AQuick Check:
WebSocket balances real-time updates and mobile constraints [check]
Hint: WebSocket with reconnection beats gRPC streaming on mobile [check]
Common Mistakes:
3. If the Market Data Feed component crashes and stops publishing updates, what is the exact failure observed by external clients subscribing to real-time stock prices?
medium
Solution
Step 1: Understand Market Data Feed failure impact
When Market Data Feed crashes, it stops pushing updates; clients detect connection loss and receive error events triggering reconnection.Step 2: Eliminate other options
Clients receive stale prices indefinitely with no indication of failure is wrong because clients detect connection loss; Clients receive partial updates but with delayed timestamps causing confusion is wrong because partial updates don't occur without feed; Clients continue receiving cached data from the Matching Engine without updates is wrong because Matching Engine doesn't serve cached market data.Final Answer:
Option C -> Option CQuick Check:
Feed crash -> clients get error + reconnect attempts [check]
Hint: Feed crash triggers client error and reconnect [check]
Common Mistakes:
4. At 10x scale, which component in the CDN architecture for adaptive bitrate HLS streaming is most likely to fail first, and why?
hard
Solution
Step 1: Identify bottleneck at 10x scale
Edge cache nodes have limited storage and memory; increased users cause cache thrashing and more origin fetches, increasing latency and load.Step 2: Evaluate other components
Origin servers scale with CDN design; load balancers are horizontally scalable; client players are distributed and not a system bottleneck.Final Answer:
Option B -> Option BQuick Check:
Edge cache storage limits cause cache thrashing first at scale [check]
Hint: Edge cache storage limits cause thrashing before origin overload [check]
Common Mistakes:
5. At 10x scale, which component in the job portal system is most likely to become the first bottleneck, and why?
hard
Solution
Step 1: Identify stateful components limiting scale
WebSocket servers hold persistent connections bound to server memory, limiting resharding.Step 2: Compare other components
Relational DB (A) can be scaled with sharding; search cluster (C) scales horizontally; message queues (D) can add partitions. Stateful WebSocket servers (B) face connection stickiness and memory limits first.Final Answer:
Option A -> Option AQuick Check:
Stateful WebSocket connections -> scaling bottleneck at 10x load [check]
Hint: Stateful WebSocket servers limit horizontal scaling first [check]
Common Mistakes:
