What is event-driven architecture?

Why Interviewers Ask This

Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid System Design basics — a prerequisite for any developer role.

Answer

Event-driven architecture (EDA) is a software design pattern where components communicate by producing and consuming events — notifications that something happened — rather than direct synchronous calls. Core components: Event producers: generate events when something happens (user registered, order placed, payment processed); Event broker: receives, stores, and routes events (Kafka, RabbitMQ, AWS EventBridge, SNS/SQS); Event consumers: subscribe to events and react (send welcome email, update inventory, generate invoice). Event types: Domain events: something that happened in the business domain (OrderPlaced, PaymentSucceeded); Integration events: crossing microservice boundaries; Commands vs Events: commands are directed requests ("send email to user 1"); events are facts ("user 1 registered" — anyone can react). Benefits: loose coupling (producers don't know consumers), scalability (consumers scale independently), resilience (consumer failures don't affect producer), extensibility (add new consumers without changing producers), event replay (reprocess past events for new features). Challenges: eventual consistency, complex debugging (trace event chains), event schema evolution, duplicate events (consumers must be idempotent). Patterns: Event Sourcing (store events as the source of truth, derive state), CQRS (separate read/write models), Choreography (services react to events) vs Orchestration (central orchestrator directs services).

Common Mistake

A common mistake is memorizing definitions without understanding implications. When asked this question, go one level deeper — explain what happens when this concept is misused or ignored.