Summary

A message queue distributes work to consumers, usually removing messages after processing. An event stream stores an ordered log that consumers can replay.

Interview Points

  • Queues are good for background jobs and work distribution.
  • Streams are good for event history, replay, analytics, and multiple independent consumers.
  • Queue consumers usually compete for messages.
  • Stream consumers track offsets independently.
  • Streams need retention, partitioning, ordering, and schema strategy.

2-3 Minute Interview Script

“A message queue is usually about work distribution. Producers enqueue tasks, consumers process them, and messages are acknowledged and removed. This fits email jobs, image processing, or background workflows.

An event stream is an append-only log. Events are retained for some period, and consumers track their own offsets. That allows replay, multiple independent consumers, and event-driven integration.

The tradeoff is complexity. Streams need partitioning, ordering decisions, retention policies, and schema evolution. Queues are often simpler when you just need reliable task processing.

Interview answer: use a queue for work; use a stream for facts and replayable event history.”

Follow-Ups

  • Why are offsets useful?
  • How do partitions affect ordering?