Event-Driven Architecture Interview Questions
2,511 multiple-choice tech interview questions on Event-Driven Architecture: events vs commands, pub/sub and event streaming, event notification vs state transfer, temporal and location decoupling, business events, the Reactive Manifesto, event granularity and naming, delta vs full-state payloads, private vs public events, enrichment, correlation IDs and event catalogs, event contracts, schema registries and compatibility, CloudEvents and schema evolution, event sourcing fundamentals, event streams, snapshots and replay, optimistic concurrency, event stores and store products, catch-up and persistent subscriptions, projection checkpoints and rebuilds, CQRS in practice, command and query models, read-model design, command validation and separate stores, choreography and orchestration, sagas and compensations, routing slips and process managers, durable execution, dual-write and ghost events, reconciliation, apology-oriented design, listen-to-yourself, claim check, read-your-own-writes, consistency SLOs, stream processing, tumbling hopping and session windows, event time and watermarks, stream-table duality, complex event processing, lambda architecture, absence alerts, operating event-driven systems, ordering and idempotency. Written for technical phone screens and interview prep, organized by subtopic, with a short explanation for every answer. Learn the 153 key terms with the flashcards first, then test yourself.
Take the practice test · Flashcards · All study tools
What it covers
- 3.1 Event-driven fundamentals and interaction styles
- 3.2 Designing events: granularity, naming and payloads
- 3.3 Event contracts, schemas and evolution
- 3.4 Event sourcing fundamentals
- 3.5 Event stores, projections and replays
- 3.6 CQRS in practice
- 3.7 Choreography, orchestration and long-running processes
- 3.8 Consistency, failure and the user experience
- 3.9 Stream processing and operating event-driven systems
Key terms
3.1 Event-driven fundamentals and interaction styles
- Event
- An immutable record of something that happened
- Publish-subscribe
- Pattern where publishers send events to all interested subscribers
- Event-carried state transfer
- Events carrying enough data for consumers to avoid callbacks
- Schema registry
- Store of versioned event schemas with compatibility checks
- Event notification
- Event says something changed; consumers fetch details
- Event producer
- Component that publishes events when something happens
- Event channel
- Topic, stream or queue that carries events
- Temporal decoupling
- Producer and consumer don't need to run at the same time
- Location decoupling
- Producers don't know where consumers run
- Event mesh
- Network of brokers routing events across environments
- Business event
- Event meaningful to the domain, like `OrderPlaced`
- Reactive Manifesto
- 2014 call for responsive, resilient, elastic, message-driven systems
- Fire-and-forget
- Publishing a fact without waiting for any consumer to process it or reply; the channel is responsible for delivery
- Event consumer
- A component that subscribes to a channel and reacts when events arrive
- Event bus
- A shared channel that many producers and consumers use to exchange events without addressing one another directly
- Event-first thinking
- Designing around the facts that happen in the business, then letting APIs and subscribers follow from those facts
- Technical event
- An event about infrastructure or internals, such as DiskFull, rather than a fact the business would name
- Message-driven
- The Reactive Manifesto quality of communicating by asynchronous messages so components stay isolated
- Event streaming platform
- A log-oriented system that retains events for a period so consumers can replay history, unlike a broker that typically deletes a message after it is consumed
3.2 Designing events: granularity, naming and payloads
- Delta event
- Event carrying only what changed
- Full-state event
- Event carrying an entity's complete current state
- Crypto shredding
- Deleting per-person encryption keys to erase data in immutable logs
- Private event
- Internal event not published as a contract
- Public event
- Event published as a contract for other services
- Event enrichment
- Adding related data to an event in transit
- Correlation ID
- ID tying together events in one business flow
- Event catalog
- Searchable list of events, schemas and owners
- Summary stream
- Downstream stream condensing a busy feed for other consumers
- Event granularity
- The size of the business fact each event type is meant to announce, not merely the byte size of the payload
- CRUD event
- A generic updated or similar event that dumps a record change without saying which meaningful fact occurred
- Event granularity drift
- Events growing coarser or finer over time without a deliberate design, so a type no longer names one clear fact
- Event subject
- The entity an event is about, identified by a stable published key such as an order id
- Reverse-DNS event type
- A namespaced event type such as com.shop.order.placed that keeps fact names unique under a domain the team owns
- Need-to-know payload
- A published event that carries the data consumers must have to act and leaves out the rest, especially sensitive or internal fields
- Business time
- When the fact happened in the domain, carried as occurred-at, which may differ from when the event was published or processed
3.3 Event contracts, schemas and evolution
- Backward compatibility
- New readers can read data written with an old schema
- Forward compatibility
- Old readers can read data written with a new schema
- Full transitive compatibility
- Compatible both ways with every earlier version
- Upcasting
- Converting old event versions to a new shape on read
- Consumer-driven contract
- Consumers state needs; producers test against them
- AsyncAPI
- Spec format for describing event-driven APIs
- CloudEvents
- CNCF spec for common event metadata
- Schema registry subject
- Name under which a schema's versions are stored
- JSON Schema
- Standard for describing and validating JSON
- Event contract
- The published agreement of event names, schemas, and compatibility rules that consumers may depend on
- Writer schema
- The schema the producer used when it encoded a published event
- Reader schema
- The schema a consumer uses when it decodes an event, which may differ from the writer's
- Schema as code
- Keeping event schemas in version control so changes get review, history, and automated compatibility checks
- Side-by-side versioning
- Publishing a new event contract version alongside the old one until consumers have migrated
- Compatibility mode
- The registry rule — backward, forward, full, none, or a transitive variant — applied when a new schema version is registered
- Semantic change
- A change in a field's meaning that keeps the same schema shape and therefore evades structural compatibility checks
3.4 Event sourcing fundamentals
- Event sourcing
- Persisting state as an append-only sequence of events
- CQRS
- Separating the write model (commands) from read models (queries)
- Projection
- Read model built by processing an event stream
- Event stream
- Ordered events for one entity in event sourcing
- Rehydration
- Rebuilding an aggregate's state by replaying its events
- Decide function
- Takes state and a command, returns events or an error
- Evolve function
- Applies one event to state to produce the next state
- Temporal query
- Asking what state was at a past moment
- Reversal event
- New event that offsets an earlier one
- Closing the books
- Ending a stream at a period and starting a fresh one
- Forgettable payload
- Personal data kept outside events so it can be deleted
- Expected version
- The stream revision a writer must still observe for an append to be accepted
- Stream revision
- The monotonically increasing version of one event stream, used to name its head
- State fold
- The left-to-right reduction of an event stream that produces current state from an initial value and each fact
- Conditional append
- A write that succeeds only if the stream is still at an expected revision
- Intent-revealing event
- An event named for the business decision that occurred, not a generic field patch
- Deterministic apply
- An evolve function free of clocks, randomness, and I/O so every replay of the same events agrees
- Stream head
- The latest revision, or latest event, of a stream — the point from which the next append continues
3.5 Event stores, projections and replays
- Event store
- Database for appending and reading event streams
- KurrentDB
- Event store database formerly called EventStoreDB
- Marten
- .NET library using PostgreSQL as a document and event store
- Axon Framework
- JVM framework for CQRS and event sourcing
- Global position
- Order of all events across all streams
- Catch-up subscription
- Reads from a past position, then follows live events
- Checkpoint
- Last processed position a projection resumes from
- Inline projection
- Read model updated in the same transaction as events
- Snapshot
- Saved state at a version to speed up loading
- Projection lag
- How far a projection trails the latest event
- Copy-transform migration
- Moving events to a new store with transformation
- Stream category
- A family of streams that share a type prefix, such as all order streams
- Multi-stream projection
- A read model built by folding events from many streams into one view
- Async projection
- A view updated in the background after events are stored, so the write path does not wait
- Persistent subscription
- A store-managed, checkpointed consumer group that can share work across competing workers
- Blue-green projection
- A new copy of a view built beside the old one, then switched once it has caught up
- Stream metadata
- Per-stream settings such as retention, truncation, and access control, stored beside the events
- System projection
- A built-in store projection that maintains feeds such as category or event-type links
3.6 CQRS in practice
- CQS
- A method either changes state or returns data, not both
- Read model
- Data shaped for a specific query or screen
- Command handler
- Code that validates a command and changes state
- Query handler
- Code that reads a read model and returns results
- Thin read layer
- Direct queries without domain objects
- Task-based UI
- Screens built around user intents
- Mediator
- Dispatches commands and queries to handlers
- Command bus
- An in-process or remote dispatcher that delivers commands to their handlers
- Physical CQRS
- A command/query split that uses separate infrastructure for the write store and the query store
- Command validation
- Fail-fast checks of a command's shape and obvious rules before official business decisions run
- Optimistic update
- A UI technique that shows the intended result immediately and later confirms or corrects it
- Provisional result
- A temporary, not-yet-confirmed display of a change while the official view is still catching up
- Consistency window
- How stale a given query model is allowed to be
- Status resource
- A follow-up resource a client can poll or subscribe to after a command is accepted
3.7 Choreography, orchestration and long-running processes
- Choreography
- Services react to each other's events with no coordinator
- Orchestration
- A coordinator tells services what to do next
- Routing slip
- Message carrying its own list of steps
- Saga
- Long transaction split into steps with compensations
- Saga countermeasure
- Technique reducing anomalies from a saga's missing isolation
- Forward recovery
- Retrying steps until the process completes
- Temporal activity
- Side-effecting workflow step that is retried as needed
- Durable execution
- Workflows as code that survive crashes by replaying history
- BPMN
- Standard notation for business process models
- Deadline message
- Scheduled message firing if a step is late
- Choreography-based saga
- A saga that advances through independent event reactions and compensations, without a central coordinator
- Orchestration-based saga
- A saga whose steps and compensations are directed by a coordinator that keeps process state
- Workflow-as-code
- A process definition written and tested as ordinary code, with an engine providing durable waits and recovery
- Continue-as-new
- Ending a workflow execution and starting a logical continuation so a long-lived process does not grow an unbounded history
- Deterministic workflow
- Process code that makes the same decisions when replayed against its recorded history
- Outcome event
- A fact a process publishes when an instance reaches a business end, such as success, failure, or cancellation
- Human task
- A workflow step that waits for a person, such as an approval or review, and may take hours or days
3.8 Consistency, failure and the user experience
- Dual-write problem
- Inconsistency from writing to a database and a broker separately
- Idempotent consumer
- A consumer that safely handles duplicate events
- Claim check
- Sending a reference to a large payload stored elsewhere
- Read your own writes
- A user sees their own change even if others see it later
- Consistency SLO
- Target for how quickly copies converge
- Ghost event
- Event published for a change that was rolled back
- Reconciliation job
- Periodic check that copies match the source
- Listen to yourself
- Service updates its own state by consuming its own event
- Apology-oriented design
- Accepting rare conflicts and fixing them with a business remedy
- Life beyond Distributed Transactions
- Pat Helland's 2007 paper on scaling without global transactions
- Publish after commit
- Publishing a business event only after the official change is durable, with the intent to publish stored in the same transaction
- Observed lag
- The freshness delay actually measured for a view, from official write to that copy becoming correct
- Making amends
- A designed official repair and honest message when a rare conflict or a wrong guess has already affected a person
- Memories, guesses, and apologies
- Pat Helland's framing: official local facts, conclusions from incomplete information, and repairs when a guess was wrong
- Entity-local transaction
- A commit that covers only one entity's official state, with other entities coordinated by messages rather than one distributed lock
- Dirty publish
- Publishing an event for a change that has not committed, or that later rolls back, which can create a ghost event
- Offloaded payload
- A large or sensitive object stored outside the bus, referenced from a claim-check event rather than carried in the message body
3.9 Stream processing and operating event-driven systems
- Stream processing
- Continuous computation over events as they arrive
- Tumbling window
- Fixed, non-overlapping time bucket
- Hopping window
- Fixed-size windows overlapping by a step
- Session window
- Window ending after an idle gap
- Event time
- When an event actually happened
- Processing time
- When the system handles an event
- Watermark
- Estimate that earlier events have mostly arrived
- Stream-table duality
- Tables are stream state; streams are table changes
- Complex event processing
- Detecting patterns across many events
- Lambda architecture
- Combined batch and streaming layers
- Absence alert
- Alert when expected events stop arriving
- Allowed lateness
- How long after the watermark a window still accepts late events and updates its result
- Keyed state
- Per-key memory in a stream operator that is checkpointed and restored with the input
- Session gap
- The idle interval that closes a session window for a key
- Event flow map
- A diagram of who publishes and consumes which events, used to understand change impact and incidents
- Idle watermark
- A watermark advanced despite a quiet source so other partitions are not held back
- Bounded out-of-orderness
- The assumed maximum delay used to generate watermarks from observed event times
- Side output
- A secondary stream for late or exceptional events that should not be silently dropped from the main path
Sample practice questions
What is an event in event-driven architecture?
- An immutable record that something happened, like OrderPlaced
- A request telling one specific service to carry out an action
- A scheduled cron job that runs at a fixed time each day
- A database index that speeds up lookups by timestamp
Answer: A. An immutable record that something happened, like OrderPlaced Events are named in the past tense and represent facts.
How fine-grained should events be?
- As large as possible, to reduce event counts
- Each should cover one database column update
- One event per day summarizing all changes
- Each should describe one meaningful business change
Answer: D. Each should describe one meaningful business change Not too chatty, not too coarse.
Why should event names and payloads be treated as a public contract?
- Many consumers depend on them, so breaking changes hit other teams
- Events are only ever read by the service that published them
- Event payloads are never parsed by consumers, only forwarded
- Event names are encrypted, so changing them breaks the keys
Answer: A. Many consumers depend on them, so breaking changes hit other teams Evolve schemas compatibly: add optional fields, avoid renaming or removing.
What is event sourcing?
- Storing state changes as append-only events and replaying them
- Logging events to a file purely for debugging purposes
- Sourcing events from social media feeds for analytics
- Storing only the latest state of each entity in a table
Answer: A. Storing state changes as append-only events and replaying them The event log becomes the source of truth and provides a full audit history.
What is a projection in event sourcing?
- A forecast of which events are likely to happen in the near future
- A backup copy of the event store kept in another region
- A process that builds a read model, like current balances, from events
- A screen in the user interface that displays recent events
Answer: C. A process that builds a read model, like current balances, from events Projections can be rebuilt from scratch by replaying events.
What does CQRS stand for, and what does it separate?
- Central Queue Routing Service: it separates message queues by region
- Cached Query Result Store: it separates the cache from the database
- Consistent Query Replication System: it separates database replicas
- Command Query Responsibility Segregation: separate write and read models
Answer: D. Command Query Responsibility Segregation: separate write and read models Read models can be denormalized and optimized for each screen.
What is a common way to make event-driven sagas recoverable after a crash?
- Keep the saga's state only in memory so that it recovers quickly
- Persist saga state and make each step and compensation idempotent
- Restart the whole saga from the beginning without any checks
- Disable retries so that failed steps can't run more than once
Answer: B. Persist saga state and make each step and compensation idempotent Durable orchestrators such as Temporal, Durable Functions and Step Functions persist this state for you.
Consumers of an event stream may receive the same event twice. What should they do?
- Assume that duplicate events never happen in practice
- Crash deliberately whenever a duplicate event arrives
- Process idempotently, such as tracking processed IDs or upserting
- Ask the publisher to resend every event from the start
Answer: C. Process idempotently, such as tracking processed IDs or upserting At-least-once delivery is the norm, so idempotency is essential.
How do you debug a business flow that spans five services reacting to each other's events?
- Read each of the five services' databases directly and compare them
- Add sleep statements to each service so the flow is easier to follow
- Pass a correlation or trace ID in events, with tracing and central logs
- Turn off asynchronous processing so everything runs synchronously
Answer: C. Pass a correlation or trace ID in events, with tracing and central logs Without correlation, event-driven flows are hard to follow.
What is the main benefit of publish-subscribe events between services?
- Guaranteed instant consistency across every service at once
- Fewer moving parts than making direct service-to-service calls
- Loose coupling: publishers don't know or wait for subscribers
- Much easier step-through debugging of flows across services
Answer: C. Loose coupling: publishers don't know or wait for subscribers The tradeoff is harder end-to-end visibility and eventual consistency.
More Architecture
- System Design Interview Fundamentals
- Monoliths vs Microservices
- Scalability: Horizontal and Vertical Scaling, Sharding and Partitioning
- CAP Theorem and Distributed Consistency
- High Availability and Fault Tolerance
- API Gateways and Service Meshes
- Domain-Driven Design
- Clean and Hexagonal Architecture
- Security Architecture: Zero Trust and OWASP Top 10
- AI and LLM Integration: RAG, Prompts and APIs