Practice
1. In the digital wallet system's transaction processing flow, at Step 4 the Ledger Service applies the debit and credit entries. What happens if the Ledger Service detects a mismatch in the double-entry records at this step?
easy
Solution
Step 1: Understand Ledger Service's double-entry validation
The Ledger Service enforces double-entry consistency; mismatches indicate data corruption or bugs.Step 2: Evaluate failure handling
Retrying indefinitely (A) risks blocking; ignoring mismatch (C) breaks accounting; deleting entries (D) risks data loss. Marking failed and alerting (B) enables safe manual reconciliation.Final Answer:
Option B -> Option BQuick Check:
Mismatch triggers failure mark and alert -> safe reconciliation [check]
Hint: Mismatch triggers failure mark and alert, not silent retry [OK]
Common Mistakes:
2. In the message delivery trace, at Step 4 the Delivery Worker checks the consumer offset stored in ZooKeeper before sending messages. What happens if the offset is missing at this step?
easy
Solution
Step 1: Understand consumer offset role
The offset tracks the last consumed message; if missing, the consumer has no progress marker.Step 2: Delivery Worker behavior on missing offset
Kafka semantics dictate resetting to earliest offset to avoid message loss; skipping (A) would lose messages; blocking (C) causes deadlock; deleting partition (D) is invalid.Final Answer:
Option A -> Option AQuick Check:
Missing offset -> reset to earliest offset to ensure delivery [check]
Hint: Missing offset resets to earliest message, never skips or blocks [check]
Common Mistakes:
3. A system requires handling 1 million writes per second with guaranteed durability and ordered processing per user session. Which database technology best fits this requirement?
easy
Solution
Step 1: Identify ordering and durability needs
Relational DBs with row-level locking can't handle 1M writes/sec efficiently; Redis without persistence loses durability; NoSQL eventual consistency lacks ordering guarantees.Step 2: Recognize Kafka's partitioning for ordering
Kafka partitions by user session ensure ordered processing and durability at high throughput.Final Answer:
Option A -> Option AQuick Check:
Kafka partitions -> ordered, durable, high-throughput writes [check]
Hint: Kafka partitions preserve order and durability at scale [check]
Common Mistakes:
4. For a high-throughput system requiring SSL termination and HTTP header manipulation, which architecture is more appropriate and why?
medium
Solution
Step 1: Identify component capabilities
Load Balancers typically operate at transport layer and may support SSL termination but lack detailed HTTP header manipulation; API Gateways add overhead and are less optimized for raw throughput; DNS load balancing does not handle SSL termination.Step 2: Match requirement to component
Reverse Proxy operates at HTTP layer, supports SSL termination and header manipulation efficiently, suitable for high throughput.Final Answer:
Option A -> Option AQuick Check:
Reverse Proxy = HTTP layer control + SSL termination [check]
Hint: Reverse Proxy = SSL termination + HTTP header control [check]
Common Mistakes:
5. At 10x scale, which component in a GraphQL API gateway is most likely to become the bottleneck and why?
hard
Solution
Step 1: Identify components stressed by 10x scale
Database scaling is often handled by sharding or replicas; load balancers scale horizontally; client SDKs are local.Step 2: Recognize GraphQL parsing and validation cost
Parsing and complexity validation are CPU-bound and happen per request, becoming CPU bottlenecks at high request rates.Final Answer:
Option B -> Option BQuick Check:
GraphQL validation CPU cost scales linearly with requests [check]
Hint: GraphQL validation CPU cost limits scale first [check]
Common Mistakes:
