Practice
1. In a digital wallet system handling millions of transactions per second, which component is best suited to ensure atomicity and durability of each transaction while decoupling the write load from downstream processing?
easy
Solution
Step 1: Identify Kafka's role in durability and ordering
Kafka provides a durable, append-only log with partition keys ensuring ordering per wallet or transaction, enabling atomicity and replayability.Step 2: Eliminate other options based on constraints
Relational DB synchronous commits (A) cause high latency and throughput bottlenecks; Redis (C) lacks durability guarantees; NoSQL eventual consistency (D) risks inconsistent ledger states.Final Answer:
Option C -> Option CQuick Check:
Kafka partitions with transaction keys -> durable, ordered event log [check]
Hint: Distributed log with partition keys ensures durable ordering [OK]
Common Mistakes:
2. A system needs to serve AI code completions with sub-100ms latency while ensuring up-to-date code context. Which component is best suited to provide fast, low-latency retrieval of relevant code snippets?
easy
Solution
Step 1: Identify low-latency retrieval need
Relational DBs (A) have high query latency for vector similarity; distributed file systems (C) are for storage, not fast retrieval; message queues (D) buffer requests but don't serve retrieval.Step 2: Recognize vector search role
ANN-based in-memory vector search engines (B) provide fast approximate nearest neighbor lookups, ideal for sub-100ms latency code snippet retrieval.Final Answer:
Option B -> Option BQuick Check:
ANN vector search enables fast similarity queries [check]
Hint: Vector search engines excel at fast similarity retrieval [check]
Common Mistakes:
3. A distributed messaging system must handle 1 million writes per second and guarantee message durability despite node failures. Which component best handles this requirement?
easy
Solution
Step 1: Identify durability and high write throughput needs
Redis without persistence (A) cannot guarantee durability on failure. Relational DB (C) cannot handle 1M writes/sec synchronously without bottlenecks. Simple queue without replication (D) risks message loss.Step 2: Recognize Kafka's replication and partitioning
Kafka provides durable, replicated logs with partitioning for high throughput and fault tolerance.Final Answer:
Option A -> Option AQuick Check:
Kafka replication + partitioning -> durability and scale [check]
Hint: Kafka replicates logs for durability and scales with partitions [check]
Common Mistakes:
4. If the Kafka broker cluster loses ZooKeeper coordination, what exactly breaks in the message delivery process?
medium
Solution
Step 1: Role of ZooKeeper in Kafka
ZooKeeper manages partition leadership and consumer offsets; losing it affects coordination but not immediate message loss.Step 2: Failure impact on delivery
Without ZooKeeper, offset metadata can become inconsistent, causing consumers to re-read messages and receive duplicates (C); producers may still write (B is partially true but leadership election stalls eventually); cluster does not shut down automatically (D).Final Answer:
Option C -> Option CQuick Check:
ZooKeeper loss -> offset inconsistency -> duplicate consumer messages [check]
Hint: ZooKeeper loss corrupts offsets causing duplicates, not immediate loss [check]
Common Mistakes:
5. At 10x scale, which component in a gRPC internal service communication system is most likely to fail first and why?
hard
Solution
Step 1: Identify stateful components at scale
gRPC streaming uses HTTP/2 streams bound to server memory per client, limiting horizontal scaling.Step 2: Compare bottlenecks
Protocol Buffers serialization is CPU intensive but parallelizable. Load balancers and service registries scale better with standard techniques. Stateful streaming handlers are the first to hit resource limits.Final Answer:
Option A -> Option AQuick Check:
Stateful HTTP/2 streams -> server connection handler bottleneck [check]
Hint: Stateful streams -> server connection handler bottleneck first [check]
Common Mistakes:
