DEV Community

Cover image for Event-driven architecture for system design interviews, explained
Gowtham Potureddi
Gowtham Potureddi

Posted on

Event-driven architecture for system design interviews, explained

Event-driven architecture for system design interviews, explained

Split a system into services and you hit a fork: when an order is placed, does the order service call the payment, inventory and notification services and wait — or does it just announce "order placed" and let whoever cares react? That second answer is event-driven architecture (EDA): services communicate by emitting and reacting to events through a broker, asynchronously, instead of calling each other directly. It is a recurring system design interview concept because "make it event-driven" is an easy phrase that hides real decisions — which messaging pattern, whether events are replayable, who coordinates a multi-step flow, and the consistency and duplicate-delivery problems you inherit the moment communication goes async.

The reason it comes up is that EDA is the lever for decoupling and scale: a producer does not know or wait for its consumers, so services can be added, scaled and fail independently, and a traffic spike piles up in the broker instead of toppling a synchronous call chain. But the instant communication is asynchronous, you give up the simple guarantees of a direct call — the response is not immediate, events can arrive out of order or more than once, and the system is only eventually consistent. This guide walks what a strong candidate names out loud: what EDA is and how it differs from request-response, the patterns (pub/sub, event streaming, event sourcing, CQRS), choreography vs orchestration for multi-service flows, and the tradeoffs the follow-ups target.

Title card for a system design interview explainer on event-driven architecture, showing a producer service emitting an order-placed event into a central event broker that fans it out to several consumer services reacting independently, contrasted with a direct synchronous call chain, on a dark citrus-and-lavender background.

Why event-driven architecture comes up in system design interviews

EDA rarely gets its own prompt. It appears inside a microservices design — an order flow, a notification system, an analytics pipeline — at the moment you notice the services are calling each other in a fragile synchronous chain and one slow dependency stalls the whole request. You say "I'll make it event-driven," and the interviewer leans in: which pattern, what happens to a duplicated event, and how a user sees a consistent result when the work happens later. EDA is a favourite probe because "emit an event" is the easy half, and the hard half is the consistency, ordering and idempotency story that async communication forces on you.

The interviewer rarely lets "the services communicate through events" stand on its own. "The order service emits 'order placed' and the payment service consumes it — but the broker delivers that event twice. What happens, and how do you make sure the customer is not charged twice?" That question — correctness under duplicate and out-of-order delivery — is the one a memorised "use Kafka, it's decoupled" answer can never survive.

The rounds on Zynter are modelled on how the loop runs, not scraped from any candidate's recall. What matters for prep is the shape: you name the event flow, and the next sentence attacks the duplicate, the ordering, or the moment the data is temporarily inconsistent.

What the interviewer is really testing

An EDA answer is read on the same four dimensions as any design decision. Problem solving — did you reach for events to decouple and absorb load, or add a broker for its own sake? Communication — can you say in one sentence why async buys decoupling at the cost of eventual consistency? Technical execution — do you make consumers idempotent, handle ordering, and know when to choreograph vs orchestrate? Time management — did you spend your words on the consistency and delivery story, not on naming every broker? Reading this guide teaches the concept; it does not teach you to defend an event flow while someone duplicates a message.

What event-driven architecture is

Start with the shift in communication style, because that is the whole idea. In request-response, a service calls another and waits for the reply; the caller is coupled to the callee's availability and latency, and a chain of calls is only as fast and reliable as its slowest, least-available link. In event-driven, a service emits an event — a fact about something that happened ("order placed," "payment captured") — to a broker, and moves on; any number of consumers subscribe and react on their own time. The producer does not know who listens, does not wait, and does not break if a consumer is down.

The three roles to name: producers emit events, a broker / event bus (Kafka, a message queue, a pub/sub service) transports and often buffers them, and consumers react. Because the broker sits in the middle, it decouples producers from consumers (add a new consumer without touching the producer), buffers bursts (a spike grows the broker, not a call stack), and lets everything scale and fail independently. The cost, stated plainly: the result is asynchronous and eventually consistent — the caller gets no immediate answer, and the system is briefly in a state where the event has happened but not everyone has reacted yet.

A diagram contrasting request-response with event-driven communication: on one side a chain of services calling each other synchronously and waiting, where one slow or down service stalls the whole request; on the other side a producer emitting an order-placed event to a central broker that buffers it and fans it out to several independent consumer services — payment, inventory, notification, analytics — each reacting on its own time, decoupled from the producer and from each other.

The patterns: pub/sub, event streaming, event sourcing, CQRS

"Event-driven" is an umbrella, and naming the specific pattern is what reads as depth. The first and most important distinction is delivery-focused versus log-based:

  • Pub/sub (publish-subscribe) — the broker delivers each event to the currently-subscribed consumers and then forgets it; it is delivery-focused, with no replay. Great for fire-and-forget notifications ("send this to everyone who cares right now"). If a consumer was down, it missed the event.
  • Event streaming — events are appended to a durable, ordered, replayable log (Kafka-style) and retained; consumers read at their own offset and can replay from any point. This is what you want when events are a source of truth, when new consumers must process history, or when a consumer needs to recover by re-reading.

Two higher-level patterns built on events:

  • Event sourcing — instead of storing current state, you store the sequence of events that produced it, and rebuild state by replaying them. It gives a perfect audit log and time-travel, at the cost of complexity and rebuild time.
  • CQRS (command query responsibility segregation) — separate the write model from the read model, often with events propagating writes into read-optimised views. It pairs naturally with event sourcing and event streaming, and is how you scale reads independently of writes.

The sentence that scores: pub/sub fans an event out to current subscribers with no replay; event streaming is a durable, ordered log you can replay, which is what you want when events are the source of truth or new consumers need history — and event sourcing (store events, not state) and CQRS (split read and write models) are the patterns you reach for on top of that. Knowing that pub/sub ≠ streaming — replay is the dividing line — is the signal.

A diagram of event-driven patterns: pub/sub shown as a broker delivering an event to current subscribers and discarding it with no replay, event streaming shown as a durable ordered append-only log that multiple consumers read at their own offsets and can replay from any point, event sourcing shown as storing a sequence of events and rebuilding current state by replaying them, and CQRS shown as a separate write model and read model with events propagating writes into read-optimised views.

System Design
HLD · Core concept
Pick pub/sub vs streaming and defend it out loud

Practise on Zynter →

Choreography, orchestration, and the tradeoffs

A single event is easy; a multi-step business flow across services is where the design decisions and the failures live. First, who coordinates the flow:

  • Choreography — there is no central coordinator; each service reacts to events and emits its own, and the flow emerges from the chain ("order placed" → payment reacts and emits "payment captured" → shipping reacts). It is loosely coupled and scales well, but the end-to-end flow is implicit and hard to see or debug.
  • Orchestration — a central orchestrator explicitly drives the steps, calling or commanding each service in turn. The flow is visible and controllable in one place, at the cost of a coordinator that every step depends on. (The saga pattern uses both styles to manage a distributed transaction.)

Then the tradeoffs the follow-ups target, inherited the moment you go async:

  • Eventual consistency — the result is correct eventually, not immediately; the UI must handle "your order is being processed" rather than an instant confirmation.
  • Ordering — events can arrive out of order across partitions or consumers; where order matters, you partition by a key (all events for one order on one partition) so related events stay ordered.
  • Duplicate delivery — most brokers guarantee at-least-once, so an event can arrive twice; consumers must be idempotent (dedupe on an event id, or make the operation naturally repeatable) so a redelivery does not double-charge or double-ship.
  • Failure handling & observability — a consumer that keeps failing sends the event to a dead-letter queue for inspection; and because the flow is spread across services, you need tracing to follow one request end to end.

The sentence that scores: choreography is decoupled but the flow is implicit; orchestration centralises the flow at the cost of a coordinator — and either way I make consumers idempotent for at-least-once delivery, partition by key where ordering matters, and accept eventual consistency, with a dead-letter queue for poison messages. Naming idempotency unprompted is the single biggest tell.

A diagram of choreography versus orchestration and the tradeoffs of asynchronous events: choreography shown as services reacting to each other's events with no central coordinator so the flow is implicit, orchestration shown as a central orchestrator explicitly driving each step; alongside the async tradeoffs — eventual consistency where the result is correct only eventually, ordering preserved by partitioning related events by key, at-least-once delivery requiring idempotent consumers that dedupe on an event id, and a dead-letter queue catching repeatedly-failing events.

System Design
HLD · Core concept
Defend idempotency and ordering under duplicate delivery

Practise on Zynter →

When to use event-driven architecture (and when not)

"Make it event-driven" is not free, and a strong answer knows when the trade is worth it:

  • Reach for events when you need to decouple producers from consumers, absorb spikes (the broker as a buffer), fan one fact out to many independent reactions (an order triggering payment, inventory, email and analytics), or build an audit log / stream you can replay. Async shines when the caller does not need an immediate answer.
  • Keep it synchronous when you need an immediate, consistent response (a user waiting on a result), when a simple request-response is enough, or when the added complexity — eventual consistency, idempotency, tracing across services — is not justified by the scale.
  • The honest framing: events buy you decoupling and resilience and cost you immediate consistency and debuggability. On a small system that trade is often not worth it; as services and scale grow, it becomes essential.

The useful line: use events where decoupling and absorbing load matter more than an instant answer; keep direct calls where the user is waiting and the flow is simple. Saying you would not reach for a broker on day one is a maturity signal, not a weakness.

How to talk about event-driven architecture in an interview

The probes from every section rhyme. Master these five and you can defend an event-driven decision in any design, not just this checklist.

  • "Why event-driven instead of direct calls?" → To decouple producers from consumers and absorb spikes: the producer emits and moves on, consumers react independently, and a burst grows the broker instead of toppling a synchronous call chain — accepting eventual consistency in return. (problem solving)
  • "Pub/sub or event streaming?" → Pub/sub for fire-and-forget to current subscribers with no replay; streaming (a durable, ordered, replayable log) when events are the source of truth or new consumers need history. (communication)
  • "The broker delivers an event twice — what happens?" → Nothing bad, if consumers are idempotent: dedupe on the event id or make the operation naturally repeatable, because at-least-once delivery means duplicates are expected. (technical execution)
  • "Who coordinates a multi-step flow?" → Choreography (services react to each other's events, decoupled but implicit) or orchestration (a central coordinator drives the steps, visible but coupled) — often a saga for a distributed transaction. (problem solving)
  • "How do you keep related events in order?" → Partition by a key so all events for one entity (e.g. one order) land on the same partition and stay ordered; across partitions, order is not guaranteed. (technical execution)

Each maps to a debrief dimension. Reading them teaches the answers; it does not teach you to deliver them while someone duplicates a message — that only comes from saying them out loud.

How to prepare: a short plan

You do not need a new topic for every design. You need the event-driven vocabulary automatic, so when a design needs decoupling you reach for the right pattern without thinking.

  • Day 1: Learn the shift from request-response to events (producer, broker, consumer) and why it buys decoupling at the cost of eventual consistency, until you can draw both flows.
  • Day 2: Drill the patterns (pub/sub vs streaming, plus event sourcing and CQRS) and the tradeoffs — idempotency for at-least-once delivery, ordering by partition key, and choreography vs orchestration. These are where the follow-ups live.
  • Day 3: Place EDA inside a real design (an order flow, a notification fan-out): emit the event, make consumers idempotent, choose choreography or orchestration, and say where you'd stay synchronous. Then do it out loud, timed, with someone duplicating a message.

This explainer feeds the broader Top 25 system design interview questions — event-driven communication shows up in order systems, notifications and analytics pipelines, so getting it automatic pays off across the whole list.

Frequently asked questions

What is event-driven architecture?

Event-driven architecture is a style in which services communicate by producing and reacting to events through a broker, asynchronously, instead of calling each other directly and waiting. A producer emits an event — a fact about something that happened, like "order placed" — to a broker or event bus, and then moves on without knowing or waiting for who will handle it; any number of consumers subscribe and react on their own time. Because the broker sits in the middle, producers and consumers are decoupled (you can add a consumer without touching the producer), bursts are buffered in the broker rather than toppling a synchronous call chain, and services scale and fail independently. The trade is that communication is asynchronous and the system is eventually consistent rather than giving an immediate, strongly consistent answer.

What is the difference between pub/sub and event streaming?

The dividing line is replay. In pub/sub, the broker delivers each event to the consumers that are subscribed at that moment and then forgets it — it is delivery-focused with no retention, so a consumer that was down misses the event; it suits fire-and-forget notifications. In event streaming, events are appended to a durable, ordered, replayable log (Kafka-style) and retained, so consumers read at their own offset and can replay history from any point — which is what you want when events are a source of truth, when a new consumer must process past events, or when a consumer needs to recover by re-reading. So pub/sub is lightweight and ephemeral, while event streaming is a persistent log you can rewind.

How do you handle duplicate events in event-driven systems?

With idempotent consumers, because most brokers guarantee at-least-once delivery, which means an event can legitimately arrive more than once (after a retry, a rebalance, or a network blip). An idempotent consumer produces the same result whether it processes an event once or several times — typically by recording processed event ids and skipping duplicates, enforcing a unique constraint on the effect, or making the operation naturally repeatable (setting a value rather than incrementing it). This is what prevents a redelivered "payment captured" event from charging the customer twice. Naming idempotency, and tying it to at-least-once delivery, is the single most important thing to say when an interviewer asks what happens when an event is delivered twice.

What is the difference between choreography and orchestration?

They are two ways to coordinate a multi-service business flow. In choreography there is no central coordinator: each service listens for events and reacts by doing its work and emitting its own events, so the overall flow emerges from the chain of reactions — it is loosely coupled and scales well, but the end-to-end flow is implicit and harder to see and debug. In orchestration, a central orchestrator explicitly drives the sequence, telling each service when to act, so the flow is visible and controllable in one place, at the cost of a coordinator that every step depends on. The saga pattern, used to manage a distributed transaction across services with compensating actions on failure, can be implemented in either style.

How do I practise a system design interview out loud?

Reading about event-driven architecture is not the same as defending an event flow while an interviewer duplicates a message. On Zynter, the HLD track runs live voice rounds modelled on how real system design loops run — you talk through a design on a shared canvas, and a voice interviewer follows up one question at a time ("pub/sub or streaming here?", "the event is delivered twice — now what?", "who coordinates this flow?"), then gives you a debrief on problem solving, communication, technical execution and time management. The score is a practice signal, not a hiring decision.

Practise it on Zynter

You can say "make it event-driven." The round is won on idempotency, ordering and eventual consistency.

Pick an HLD system design round, wire your services together with events on the canvas, and defend it out loud to a voice interviewer that keeps asking "pub/sub or streaming?" and "the broker delivered that twice — how do you not double-charge?" — then read the debrief. Zynter.ai is on-demand mock interviews modelled on real company loops, with 150+ rounds across 20 companies including the HLD system design track (Sep 2026).

Practise an HLD system design round →
Browse all interview tracks

Top comments (0)