Event-Driven Architecture & Event Bus Quiz

Q1. In a microservices system, Service A triggers an event internally for its own workflow, while Service B emits an event to notify other services of a data change. What types of events are these respectively?




Q2. A UserRegistered event needs to be processed by three different microservices (Email, Analytics, and Marketing). Which messaging model ensures all three services receive the event?




Q3. The Payment service processes PaymentReceived events. Due to at-least-once delivery, the service occasionally receives duplicate events. How can the service avoid double-charging a customer from duplicate messages?




Q4. A consumer keeps failing to process a particular message due to invalid data, and it keeps retrying, blocking the queue. What is the best way to handle this “poison” message scenario?




Q5. A microservice publishes an event for every minor data change (e.g., every item in an order of 100 items results in 100 events). This floods the event bus and consumers. What anti-pattern does this illustrate?




Q6. You have an event stream partitioned by customer ID and your Order service is scaled to multiple instances (in the same consumer group). All instances consume in parallel, but you need events for the same customer to be processed in order. How can you achieve this?




Q7. An order placement saga involves multiple services (Order, Payment, Inventory). The team can either implement a central Saga Orchestrator service to call each step or use choreography where each service listens and reacts to events from the others. Which statement correctly compares these approaches?




Q8. A service updates a database and then publishes an event. Sometimes the service crashes after the DB transaction commits but before the event is sent, causing missing events. What pattern can ensure the event still gets published reliably even if the service crashes?




Q9. Your team needs to add a new field to an event’s schema that many services consume. To avoid breaking consumers, what should you do before deploying this change?




Q10. In a streaming system, you notice the consumer lag (backlog of unprocessed messages) for a consumer group is steadily increasing. What does this indicate, and how can you respond?




Q11. Service A publishes an OrderCreated event containing the entire order object (all item details, user info, etc.). Service B uses this event data directly without calling A. Later, Service A changes its internal data format, and Service B’s processing breaks. What EDA anti-pattern does this scenario illustrate?




Q12. A financial system requires that each event is processed exactly once (no duplicates, no omissions). The event bus only guarantees at-least-once delivery. How can you achieve effectively exactly-once processing in this design?




Q13. Service X needs data from Service Y. The team designs an Event Request-Response: X publishes a RequestData event and then waits for Y to publish a DataResponse event. Why is this usage of the event bus considered an anti-pattern?




Q14. To maintain consistency, a team considers using a distributed two-phase commit (2PC) across the database and the message broker so either both the DB update and event publish succeed or fail together. What is a major drawback of 2PC in a microservices context, and what is a preferred alternative?




Q15. In a saga spanning multiple services, suppose several steps succeeded but one of the later steps failed. How is this partial failure usually handled in an event-driven saga to maintain overall consistency?




software-architecture