Bird
0
0

If an event store contains these events:

medium📝 Analysis Q5 of 15
Microservices - Event-Driven Architecture
If an event store contains these events:
1: ProductAdded {productId: 10, qty: 5}
2: ProductRemoved {productId: 10, qty: 2}
What is the total quantity after replay?
A5
B3
C2
D7
Step-by-Step Solution
Solution:
  1. Step 1: Calculate quantity changes

    First event adds 5, second removes 2, net is 5 - 2 = 3.
  2. Step 2: Confirm final quantity

    After replaying both events, quantity is 3.
  3. Final Answer:

    3 -> Option B
  4. Quick Check:

    Quantity after events = 3 [OK]
Quick Trick: Add and subtract event quantities to find current total [OK]
Common Mistakes:
MISTAKES
  • Ignoring removal event
  • Adding quantities instead of subtracting
  • Using only one event

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes