advanced

Kafka, RabbitMQ, and messaging

Design queues, streams, brokers, consumers, delivery guarantees, retry flows, and broker selection for distributed JavaScript systems.

Messaging interviews test whether you can choose brokers and patterns for delivery semantics, ordering, and failure—not whether you have memorized every broker flag. Compare Kafka (log, partitions, consumer groups, replay) with RabbitMQ (exchanges, queues, routing, DLX) and simpler Redis options.

Cover reliability patterns (retry/DLQ, idempotent consumers, poison messages, exactly-once trade-offs) and selection criteria for event streaming vs task queues.

On interviews: design message flow for an order-paid event including failure, retry, and duplicate handling.

Common pitfalls: assuming exactly-once everywhere, ignoring consumer lag, and topics without retention strategy.

Checklist:

  • Name delivery guarantee you actually need.
  • Plan idempotency at consumers.
  • Separate commands from events when it matters.
  • Monitor lag, DLQ depth, and poison messages.