Practice
1. In the payment system's request flow, at Step 5 the Settlement Service receives a batch of transactions marked as 'authorized'. What does the Settlement Service do when it encounters a transaction flagged as 'already settled' during this step?
easy
Solution
Step 1: Trace Settlement Service behavior at Step 5
The Settlement Service must avoid double settlement by skipping transactions already marked as settled.Step 2: Evaluate other options
Retrying settlement risks duplicate charges; marking as failed triggers unnecessary manual work; forwarding back to Authorization Service is redundant.Final Answer:
Option C -> Option CQuick Check:
Settlement skips duplicates -> prevents double charges [check]
Hint: Settlement skips already settled transactions [check]
Common Mistakes:
2. A system must handle 1 million writes per second with flexible schema and eventual consistency. Which database technology best fits this requirement?
easy
Solution
Step 1: Identify write throughput and schema flexibility needs
Relational DBs struggle with 1M writes/sec and rigid schemas; graph DBs optimize for relationships, not write scale.Step 2: Evaluate NoSQL document store capabilities
NoSQL document stores support horizontal sharding and flexible schemas, enabling high write throughput with eventual consistency.Final Answer:
Option A -> Option AQuick Check:
NoSQL document stores scale horizontally for high writes [check]
Hint: High writes + flexible schema -> NoSQL document store [check]
Common Mistakes:
3. For minimizing end-to-end latency in converting RTMP streams to HLS, which architecture is better given mobile clients with limited HTTP/2 support?
medium
Solution
Step 1: Consider client compatibility
Mobile clients often have limited or inconsistent HTTP/2 support, making HTTP/2 server push (A) and gRPC streaming (D) unreliable.Step 2: Evaluate streaming methods
WebSocket (C) is not natively supported by HLS players and complicates caching/CDN usage. HTTP/1.1 chunked transfer encoding (B) allows progressive delivery compatible with most clients and CDNs.Final Answer:
Option A -> Option AQuick Check:
HTTP/1.1 chunked encoding streams HLS segments progressively and broadly supported [check]
Hint: Chunked HTTP/1.1 streams HLS segments; mobile supports it best [check]
Common Mistakes:
4. Without the message broker's offset commit mechanism, what exactly breaks in the delivery flow?
medium
Solution
Step 1: Role of offset commit in consumer progress tracking
Offset commits mark messages as processed; without them, consumers reprocess the same messages repeatedly.Step 2: Consequence of missing offset commits
Consumers cannot advance their read position, causing duplicate deliveries; messages are not lost or reordered inherently.Final Answer:
Option C -> Option CQuick Check:
No offset commit -> infinite duplicates, no progress [check]
Hint: No offset commit -> consumer reprocesses same messages repeatedly [OK]
Common Mistakes:
5. At 10x scale, which component in a saga-based event-driven system is most likely to fail first due to stateful bottlenecks, and why?
hard
Solution
Step 1: Identify stateful bottleneck
The saga coordinator holds per-saga state in memory, limiting horizontal scaling and sharding.Step 2: Compare other components
Message brokers scale with partitions; DB scales with sharding; relay is stateless and network-bound.Final Answer:
Option A -> Option AQuick Check:
Saga coordinator's in-memory state limits scaling first [check]
Hint: Stateful saga coordinator limits scaling before stateless components [check]
Common Mistakes:
