Bird
0
0

Given the following event log stored as tuples (timestamp, event):

medium📝 Analysis Q13 of 15
Microservices - Event-Driven Architecture
Given the following event log stored as tuples (timestamp, event):
[(1, 'create'), (3, 'update'), (2, 'update'), (4, 'delete')]
What is the correct order of events during replay?
A[('update'), ('create'), ('delete'), ('update')]
B[('delete'), ('update'), ('create'), ('update')]
C[('create'), ('update'), ('update'), ('delete')]
D[('update'), ('delete'), ('create'), ('update')]
Step-by-Step Solution
Solution:
  1. Step 1: Sort events by timestamp

    Sort the list by the first element (timestamp): 1, 2, 3, 4.
  2. Step 2: Extract event names in sorted order

    Events in order: 'create' (1), 'update' (2), 'update' (3), 'delete' (4).
  3. Final Answer:

    [('create'), ('update'), ('update'), ('delete')] -> Option C
  4. Quick Check:

    Sorted timestamps = 1,2,3,4 [OK]
Quick Trick: Sort by timestamp, then list events in that order [OK]
Common Mistakes:
MISTAKES
  • Ignoring timestamp order
  • Mixing event sequence
  • Assuming original list order is correct

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes