Practice
1. A Q&A platform needs to handle 1 million new questions and answers per day, ensuring that user feeds update with minimal latency and high availability. Which component is best suited to decouple write-heavy ingestion from real-time feed generation?
easy
Solution
Step 1: Identify ingestion and feed update decoupling
Direct synchronous writes (A, D) block user requests and reduce availability under high load. Redis without persistence (C) risks data loss on failure.Step 2: Evaluate Kafka's role
Kafka buffers high write throughput, supports partitioning for scalability, and decouples ingestion from feed generation, ensuring durability and replayability.Final Answer:
Option B -> Option BQuick Check:
Kafka buffers high write load, enabling asynchronous feed updates [check]
Hint: Buffer writes with durable queue to decouple ingestion [check]
Common Mistakes:
2. If the Kafka cluster is unavailable, what exactly breaks in the log aggregation pipeline?
medium
Solution
Step 1: Identify Kafka's role
Kafka buffers logs between producers and processors, enabling decoupling.Step 2: Trace failure impact
If Kafka is down, producers may retry or block, but processors cannot consume new logs, halting enrichment.Final Answer:
Option B -> Option BQuick Check:
Kafka down -> processors stall on new logs, old logs processed [check]
Hint: Kafka outage stalls processors, not immediate producer loss [check]
Common Mistakes:
3. For a mobile app requiring real-time notifications at 10x scale, which architecture is better and why?
medium
Solution
Step 1: Evaluate mobile client support
gRPC streaming (Use gRPC streaming for persistent connections to push notifications) is efficient but poorly supported on many mobile platforms, causing compatibility issues.Step 2: WebSockets with connection broker
WebSockets (Use WebSockets with a scalable connection broker to handle mobile client limitations) are widely supported on mobile and, with a scalable broker, can handle millions of connections efficiently.Step 3: Polling drawbacks
Long polling (Use long polling HTTP requests to simulate real-time updates) and periodic polling (Use periodic polling every 5 seconds to reduce server load) increase latency and server load, unsuitable for real-time at scale.Final Answer:
Option A -> Option AQuick Check:
WebSockets + broker -> scalable, mobile-friendly real-time [check]
Hint: WebSockets scale better on mobile than gRPC streaming [OK]
Common Mistakes:
4. At 10x scale, which component in the ML data infrastructure is most likely to become the bottleneck first, and why?
hard
Solution
Step 1: Analyze scaling challenges per component
Feature store caches can be sharded; batch clusters scale horizontally; metadata registries are smaller and less frequently accessed.Step 2: Identify Kafka bottleneck
Kafka throughput depends on partition count, which is hard to increase dynamically. Rebalancing partitions at scale causes downtime and latency spikes, making Kafka ingestion the first bottleneck.Final Answer:
Option D -> Option DQuick Check:
Kafka partition limits and rebalancing cause ingestion bottlenecks [check]
Hint: Kafka partitions limit throughput; rebalancing causes downtime [check]
Common Mistakes:
5. At 10x traffic scale, which component is most likely to fail first in a system without rate limiting, and why?
hard
Solution
Step 1: Analyze component scalability at 10x traffic
Databases (A) and caches (D) can be scaled horizontally or sharded; load balancers (C) can be scaled or replaced with L4/L7 solutions.Step 2: Identify API servers as bottleneck
API servers maintaining stateful connections (e.g., WebSockets) are hard to shard or move; connection limits cause saturation and failure first.Final Answer:
Option D -> Option DQuick Check:
Stateful API servers hit connection limits first at scale [check]
Hint: Stateful API servers fail first due to connection limits [check]
Common Mistakes:
