Module Quiz
Complete this quiz after finishing all concept and practice pages.
Current Module Questions
Question 1: What Is an Event?
State, in one sentence, the three non-negotiable properties of an event, and give one example of a "message" that is not an event and why.
Answer: An event is past tense, immutable, and authored by the system that knows it happened. SendWelcomeEmail is not an event: it is imperative (a command to a specific handler), not a fact, and its consumer count is one, not many.
Common Errors:
- Confusing "past tense" with "past timestamp" -- any old CRUD row has a timestamp; only an event is named by the domain transition.
- Accepting
OrderUpdatedas an event -- it is a summary, not a specific fact; it erases which transition occurred.
If You Got This Wrong:
- Review Concept 01.
Question 2: Event vs Command vs Query
A team proposes a topic called order-events carrying PlaceOrder, OrderPlaced, GetOrderStatus, and CancelOrder. Identify each message's real intent and propose the corrected topic/endpoint for each.
Answer:
PlaceOrder-> command -> queuepayment.commandsor HTTP endpoint; single consumerOrderPlaced-> event -> topicorder.placed; pub-subGetOrderStatus-> query -> HTTP/gRPC endpoint; never on a brokerCancelOrder-> command -> queueorder.commandsor HTTP endpoint
Mixing them on one topic hides intent and forces future engineers to add "only one consumer please" comments.
Question 3: Pick the Messaging Pattern (Scenario 1)
A checkout service publishes that an order was placed; four other services react (billing, inventory, notifications, analytics). Which messaging pattern and why?
Answer: Publish-subscribe topic. Each subscriber reacts independently; adding fraud-detection as a fifth subscriber next month must not require changes to the publisher. Point-to-point queue would give the message to only one consumer; work-distribution semantics here would be wrong.
Question 4: Pick the Messaging Pattern (Scenario 2)
An image-processing service accepts upload events and generates thumbnails. 10 workers share the load. Which messaging pattern and why?
Answer: Point-to-point queue (work distribution). Each image is a task that exactly one worker should process. Pub-sub would cause every worker to regenerate the same thumbnails -- both wasteful and potentially corrupt (race on storage). Scale is adding workers sharing the queue.