0
0
Microservicessystem_design~20 mins

Event sourcing pattern in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Event Sourcing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary benefit of using event sourcing in microservices?

Consider a microservices system that uses event sourcing. What is the main advantage of this pattern?

AIt stores the current state only, reducing storage needs.
BIt guarantees zero network latency between services.
CIt eliminates the need for any database in the system.
DIt allows reconstructing past states by replaying events.
Attempts:
2 left
💡 Hint

Think about how event sourcing handles data changes over time.

Architecture
intermediate
2:00remaining
Which component is essential in an event sourcing architecture?

In an event sourcing system, which component is responsible for storing all the events?

AEvent Store
BCommand Handler
CRead Model
DAPI Gateway
Attempts:
2 left
💡 Hint

Think about where the system keeps the history of all changes.

scaling
advanced
2:00remaining
How does event sourcing help with scaling read operations in microservices?

In a microservices system using event sourcing, how can read operations be scaled efficiently?

ABy replaying events on demand for every read request.
BBy blocking writes during heavy read traffic.
CBy using separate read models built from events for queries.
DBy storing all data in a single monolithic database.
Attempts:
2 left
💡 Hint

Consider how read models can be optimized separately from writes.

tradeoff
advanced
2:00remaining
What is a common tradeoff when using event sourcing in microservices?

Which of the following is a typical downside of adopting event sourcing?

AIncreased complexity in rebuilding current state from events.
BImmediate consistency without eventual consistency concerns.
CSimpler debugging due to fewer stored data points.
DNo need for backups because events are immutable.
Attempts:
2 left
💡 Hint

Think about the effort needed to get the current state from stored events.

estimation
expert
3:00remaining
Estimate the storage growth in an event sourcing system over time.

A microservice using event sourcing records 1000 events per minute. Each event is 1 KB in size. Estimate the storage needed after 1 year (assume 365 days).

AAbout 525 TB
BAbout 525 GB
CAbout 525 MB
DAbout 525 KB
Attempts:
2 left
💡 Hint

Calculate total events per year and multiply by event size.