Practice
1. A system must ingest 1 million events per second with guaranteed ordering per user session and durable storage. Which component best handles this ingestion requirement?
easy
Solution
Step 1: Identify Kafka's role in ingestion
Kafka supports high-throughput ingestion with partitioning by user session ID, ensuring ordering per session and durability via log storage.Step 2: Eliminate alternatives
Relational DB batch inserts can't handle 1M events/sec with ordering guarantees; Redis Pub/Sub lacks durability and ordering guarantees; HTTP with in-memory queueing risks data loss and no ordering guarantees.Final Answer:
Option C -> Option CQuick Check:
Kafka partitions keyed by session ensure ordering and durability [check]
Hint: Kafka partitions preserve ordering per key [check]
Common Mistakes:
2. In the request flow of the leaderboard system, at step 4 the Ranking Worker reads the updated score from Redis Sorted Sets. What state does the Ranking Worker observe if the score update was just written but the TTL expired simultaneously?
easy
Solution
Step 1: Understand Redis TTL eviction behavior
Redis removes keys immediately after TTL expiration, so if TTL expired, the score entry is deleted.Step 2: Trace Ranking Worker read at step 4
Ranking Worker reads Redis Sorted Set; if key expired, it finds no entry, not stale or partial data.Final Answer:
Option A -> Option AQuick Check:
Redis TTL expiry deletes keys before read, so no score entry found [check]
Hint: TTL expiry deletes keys before reads, no stale data returned [check]
Common Mistakes:
3. Without the distributed consensus mechanism in a NoSQL cluster, what exactly breaks during a network partition?
medium
Solution
Step 1: Understand distributed consensus role
Consensus protocols ensure coordinated writes and consistency across nodes.Step 2: Trace failure without consensus during partition
Without consensus, the cluster cannot safely coordinate writes and may fallback to a safe mode or external system.Final Answer:
Option D -> Option DQuick Check:
No consensus -> fallback to relational DB (plausible in some designs) [check]
Hint: No consensus -> fallback to safe storage [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, which component is most likely to become the bottleneck first in a read-heavy CQRS system with read replicas, and why?
hard
Solution
Step 1: Analyze scaling impact on components
Write volume and event propagation increase 10x, stressing the event queue.Step 2: Compare bottlenecks
Primary DB writes scale with writes, not reads; read replicas scale horizontally; client caches don't cause exponential invalidation.Final Answer:
Option A -> Option AQuick Check:
Event queue overwhelmed first due to write event surge [check]
Hint: Event queue chokes first as write events surge 10x [check]
Common Mistakes:
