Practice
1. In the event sourcing system trace, at Step 4 the Delivery Worker reads an event from Kafka and attempts to update the read model. What happens if the read model update fails due to a transient database error?
easy
Solution
Step 1: Trace Delivery Worker decision at Step 4 -- read model update
The Delivery Worker must ensure the read model is updated before committing the Kafka offset to avoid data loss.Step 2: Understand failure handling
On transient DB errors, the worker retries to guarantee eventual consistency; discarding or committing offset prematurely risks data loss.Final Answer:
Option D -> Option DQuick Check:
Retry read model update before offset commit -> ensures consistency [check]
Hint: Commit Kafka offset only after successful read model update [check]
Common Mistakes:
2. Without the bulkhead pattern implemented, what exactly happens when one microservice's database connection pool saturates under load?
medium
Solution
Step 1: Understand absence of bulkhead isolation
Without bulkheads, saturation causes blocking (B) and thread starvation, but automatic rejection (C) is a bulkhead feature. Queuing indefinitely (A) is unlikely without bulkheads. Load balancers (D) don't detect internal resource saturation.Step 2: Trace failure impact
Without bulkheads, blocking threads cause cascading failures; with bulkheads, requests are rejected to contain blast radius.Final Answer:
Option C -> Option CQuick Check:
Without bulkheads, blocking causes cascading failures [check]
Hint: No bulkheads -> blocking threads cascade failures [check]
Common Mistakes:
3. For analytics on URL redirects, you must track click counts per short code with minimal latency and high write throughput. Which storage solution is best suited for this requirement?
medium
Solution
Step 1: Analyze latency and throughput needs
High write throughput and low latency require fast atomic increments without locking overhead.Step 2: Evaluate storage options
Relational DB (A) suffers from locking; Kafka (C) adds latency due to offline processing; NoSQL (D) eventual consistency may cause inaccurate counts. Redis (B) supports atomic increments and fast writes with batch persistence.Final Answer:
Option A -> Option AQuick Check:
Redis atomic increments enable low-latency, high-throughput analytics [check]
Hint: Redis atomic increments for fast, accurate click counts [check]
Common Mistakes:
4. A company must expose internal web services securely to external clients while hiding internal server details and enabling SSL termination. Which proxy architecture is best suited for this?
medium
Solution
Step 1: Identify proxy role for exposing internal services
A reverse proxy sits in front of internal servers, hides their details, and can terminate SSL for external clients.Step 2: Eliminate other options
Forward proxies act on clients, not servers; transparent proxies don't modify requests; DNS proxies only resolve names, not handle SSL or hide servers.Final Answer:
Option A -> Option AQuick Check:
Reverse proxy hides servers and terminates SSL [check]
Hint: Reverse proxy hides servers and handles SSL termination [check]
Common Mistakes:
5. At 10x scale, which component in a cache stampede prevention system is most likely to fail first, and why?
hard
Solution
Step 1: Identify bottlenecks at 10x scale
Backend and cache scale horizontally; load balancers scale well.Step 2: Analyze distributed lock service
Lock service faces increased contention and coordination overhead, causing latency and failures.Final Answer:
Option C -> Option CQuick Check:
Distributed lock service bottlenecks first due to coordination overhead [check]
Hint: Lock service bottlenecks first due to exponential coordination overhead [OK]
Common Mistakes:
