Volume 12 · Chapter 6 — Principal Software Architect Interview Mastery & Enterprise System Design Handbook

Event-Driven Architecture Interviews

Goutham Mayaluri 7 min read .NETC#

6.1 Introduction

Event-driven architecture questions test whether you understand loose coupling, asynchronous communication, and their costs. The interviewer probes not just the happy path but the hard parts: delivery guarantees, ordering, idempotency, schema evolution, and failure handling. A strong answer treats these as first-class, because in event-driven systems the edge cases are the design.

6.2 The Core Model

Producers emit events (facts), a broker delivers them, and consumers react independently. This inverts dependencies - producers know nothing about consumers, so new reactions are added without changing producers - which is the source of both the power (extensibility, scalability, resilience) and the difficulty (asynchrony, eventual consistency, harder debugging) of the style.

sequenceDiagram
  autonumber
  participant P as Producer
  participant B as Broker (topic)
  participant Risk as Risk Service
  participant Notif as Notification
  participant Settle as Settlement
  participant Audit as Audit
  P-)B: TransactionCreated
  B-)Risk: deliver
  B-)Notif: deliver
  B-)Settle: deliver
  B-)Audit: deliver
  Note over B,Audit: Add a consumer without touching the producer

6.3 Kafka vs Service Bus (Streams vs Queues)

A common interview question. Kafka (and Event Hubs) is a log-based stream: high-throughput, retained, replayable, read by many consumers at their own offset - ideal for event streaming, analytics, and high-volume ingestion. Azure Service Bus is an enterprise message broker: queues for competing-consumer work, topics for pub/sub, with sessions, transactions, and dead-lettering - ideal for reliable business messaging and workflows. Choose by whether you need stream/replay semantics or reliable message processing.

6.4 The Hard Parts Consumers Must Handle

  • Idempotency- at-least-once delivery means consumers must dedupe or use idempotent operations.
  • Ordering- preserve per-key via partitions/sessions, not globally.
  • Retries and dead-letter queues- handle transient failures and isolate poison messages.
  • Schema evolution- additive, backward-compatible changes; version and use tolerant readers.

6.5 Reliable Publishing and Domain Events

The transactional outbox makes publishing atomic with the state change. Domain events represent meaningful business occurrences and are the vocabulary of the system; well-designed events carry enough context to be useful without forcing consumers to call back. Distinguishing internal domain events from published integration events keeps the internal model decoupled from the external contract.

Principal Architect Interview Question

How do you design a scalable, reliable event-driven architecture?

I design it around loose coupling for the benefits and rigorous handling of the hard parts for the reliability, because in event-driven systems the edge cases are the design. Producers emit well-designed domain/integration events - past-tense facts carrying enough business context to be useful - through a broker chosen for the workload: a stream like Kafka/Event Hubs when I need high throughput, retention, and replay by many independent consumers, or a message broker like Service Bus when I need reliable competing-consumer work processing with sessions, transactions, and dead-lettering. Publishing is made reliable with the transactional outbox so a state change and its event commit atomically, eliminating the dual-write problem. Consumers are designed for the realities of at-least-once delivery: every consumer is idempotent (deduping by event id or using naturally idempotent operations) so redelivery is safe; ordering, where it matters, is preserved per entity via partition keys or sessions rather than globally, so I keep parallelism across entities; transient failures are retried with backoff and poison messages are dead-lettered for investigation rather than blocking the stream. Event schemas are treated as contracts that outlive any deployment - I evolve them additively and backward-compatibly, version them when a breaking change is unavoidable, and use tolerant readers - so producers and consumers deploy independently. I separate internal domain events from published integration events so the internal model stays decoupled from the external contract. And I make the whole flow observable with correlation IDs and distributed tracing, because a business process is now an emergent choreography across services and I must be able to follow it and see stuck messages. I’d also name the trade-offs I’m accepting - eventual consistency, harder debugging, operational complexity of running a broker - and justify event-driven where its coupling and scaling benefits are genuinely needed rather than as a default. That combination - right broker, outbox, idempotent consumers, per-key ordering, DLQs, versioned schemas, and end-to-end observability - is what makes an event-driven system both scalable and reliable.

Principal Architect Interview Question

Kafka or Azure Service Bus - how do you decide?

I decide by whether the workload needs event-streaming semantics or reliable message-processing semantics, because that is the fundamental difference. Kafka (and Azure Event Hubs) is a distributed, log-based streaming platform: events are appended to partitioned, retained logs that many independent consumers read at their own offset, and can re-read or replay. It excels at high-throughput event streaming, real-time analytics, log and telemetry ingestion, and scenarios where multiple consumers need the same event stream or where replay matters - it is about throughput, retention, and streaming. Azure Service Bus is an enterprise message broker: queues deliver each message to one consumer among competing consumers (work distribution), topics provide pub/sub, and it offers sessions for ordering, transactions, duplicate detection, and dead-letter queues - it is about reliable business messaging and workflows with rich per-message semantics and delivery guarantees. So I choose Service Bus for reliable command/work processing and business workflows where each message must be handled once with strong delivery and error-handling semantics - payment processing being the classic case - and I choose Kafka/ Event Hubs for high-volume event streaming, analytics pipelines, and cases needing retention and replay across many consumers - transaction and telemetry streams feeding fraud models, for instance. Many real systems use both: Service Bus for the transactional workflow messaging and Kafka/Event Hubs for the high-throughput streaming and analytics plane. In an interview I’d frame it as streams-with-replay versus reliable-message-processing and match the choice to the workload’s actual needs rather than treating them as interchangeable.

Principal Architect Interview Question

How do you handle event schema evolution so producers and consumers can deploy independently?

I treat the event schema as a published contract that many independently-deployed services depend on, so the governing rule is never make a breaking change in place. Additive, backward-compatible changes - adding new optional fields, new event types - are safe: old consumers ignore what they do not understand and keep working, while new consumers use the new data. To make that work, consumers use tolerant readers that ignore unknown fields and default missing ones, which absorbs additive changes gracefully. When a genuinely breaking change is unavoidable - removing or renaming a field, changing its meaning - I version the event (v1 and v2), publish both during a clearly communicated migration window, and retire the old version only after telemetry confirms every consumer has moved; for event- sourced stores I use upcasters that transform old event versions into the new shape on read, since old events are immutable and live forever. I design events with enough business context up front so I rarely need to change them, and I use a schema registry and/or consumer-driven contract tests to catch incompatibilities before they ship. I also separate internal domain events (which I can evolve more freely) from published integration events (the external contract, which I evolve conservatively). The result is that producers and consumers can release on their own schedules without breaking each other, which is the entire point of the decoupling - and in an interview, emphasizing additive-by-default, tolerant readers, explicit versioning with parallel running, and contract testing shows I understand that schema governance is what keeps an event-driven system maintainable as it grows.

6.6 Banking Event-Driven Scenario

A bank publishes aTransactionCreatedevent through the outbox; risk, notification, settlement, and audit services each consume it independently and idempotently, and a new rewards service can be added without touching the producer. High-throughput transaction and telemetry streams flow through Event Hubs for fraud analytics with replay, while reliable settlement workflow messaging uses Service Bus with sessions for ordering and dead-letter queues for poison messages. Events are versioned and tolerantly read so teams deploy independently, and correlation IDs trace each transaction across every reacting service.

Chapter Revision Notes

  • Events invert dependencies - power (extensibility) and difficulty (asynchrony) both follow.
  • Kafka/Event Hubs = streaming + replay; Service Bus = reliable message processing + workflows.
  • Consumers must handle idempotency, per-key ordering, retries/DLQs - the edge cases are the design.
  • Publish reliably with the outbox; evolve schemas additively with versioning and tolerant readers.
  • Separate internal domain events from published integration contracts; trace everything.