Practice
1. A messaging platform must handle 1 million messages per second with guaranteed ordering per conversation and durability. Which component best decouples message ingestion from fan-out delivery while preserving ordering?
easy
Solution
Step 1: Identify Kafka's role in decoupling ingestion and delivery
Kafka partitions by conversation ID ensure ordering per conversation and durability via replication.Step 2: Eliminate other options
Redis pub/sub lacks durability and ordering guarantees; relational DBs can't handle 1M writes/sec with locking overhead; in-memory queues lack durability and don't scale across servers.Final Answer:
Option A -> Option AQuick Check:
Kafka with conversation_id partition -> ordering within conversation guaranteed [check]
Hint: Kafka partitions preserve ordering and durability [check]
Common Mistakes:
2. In a system where messages are produced to Kafka and consumed by a delivery worker, at step 4 the Delivery Worker reads the message offset from Kafka. What state does the Delivery Worker mark if the downstream consumer acknowledges receipt?
easy
Solution
Step 1: Understand Kafka offset commit semantics
Kafka consumers commit offsets only after processing messages successfully to avoid reprocessing.Step 2: Delivery Worker behavior on acknowledgment
Upon downstream acknowledgment, the worker marks the message as delivered and commits the offset, signaling safe processing.Final Answer:
Option C -> Option CQuick Check:
Offset commit after acknowledgment ensures exactly-once processing [check]
Hint: Commit Kafka offset only after downstream ack to avoid duplicates [check]
Common Mistakes:
3. For a full-text search system requiring low-latency queries and frequent index updates, which indexing architecture is most appropriate?
medium
Solution
Step 1: Evaluate synchronous monolithic index (A)
Updating a single large index synchronously causes high write latency and blocks queries.Step 2: Consider multi-level index (B)
Multi-level indexing with a small in-memory index for recent changes enables low-latency queries and fast incremental updates, while the large on-disk index handles bulk data efficiently.Step 3: Analyze distributed sharding (C) and batch rebuild (D)
Sharding by document ID with eventual consistency can cause stale query results; batch rebuilds cause high query latency during rebuild.Final Answer:
Option D -> Option DQuick Check:
Multi-level index balances update speed and query latency [check]
Hint: Multi-level index: fast recent updates, slow bulk storage [check]
Common Mistakes:
4. At 10x scale, which component of the distributed task scheduler is most likely to become the bottleneck first, and why?
hard
Solution
Step 1: Analyze cron scheduler scalability
Cron schedulers are typically lightweight and can be sharded or distributed; unlikely to bottleneck first (A).Step 2: Analyze worker node resource limits
Workers scale horizontally; CPU exhaustion (C) is mitigated by adding nodes.Step 3: Analyze network load balancer capacity
Load balancers scale with standard techniques; connection count (D) is manageable.Step 4: Analyze distributed priority queue bottlenecks
Priority queue faces contention on ordering, lease renewals, and coordination overhead, which grows non-linearly with scale, causing it to bottleneck first (B).Final Answer:
Option D -> Option DQuick Check:
Priority queue contention and lease overhead limit scale first [check]
Hint: Priority queue contention limits scale before others [check]
Common Mistakes:
5. At 10x scale, which observability component is most likely to fail first and why?
hard
Solution
Step 1: Analyze scaling characteristics of observability components
Tracing volume grows exponentially with request fan-out, causing storage and query bottlenecks.Step 2: Compare with other components
Logging scales linearly; metrics systems shard well; alerting scales with metrics, so less likely first failure.Final Answer:
Option C -> Option CQuick Check:
Tracing volume explosion -> backend overwhelmed first [check]
Hint: Tracing volume explodes with fan-out, stressing backend first [check]
Common Mistakes:
