Lesson 25 / 25

Revision and Interview Questions

Recall RabbitMQ concepts quickly for exams and interviews.

Cheat sheet

Model: producer → exchange → binding → queue → consumer; vhosts isolate; connections are long-lived, channels multiplex. Exchanges: default (queue name), direct (exact key), fanout (all), topic (* one word, # zero or more), headers (x-match all/any); unroutable messages are dropped unless mandatory or an alternate exchange is used. Patterns: work queues, pub/sub, routing, RPC with reply_to + correlation_id and direct reply-to. Consuming: manual acks; nack/reject with or without requeue; prefetch for fairness versus throughput; at-least-once means idempotent consumers keyed by message_id. Publishing: confirms, mandatory/returns, persistent messages on durable queues, outbox for business events. Failures: DLX on reject, TTL expiry, length overflow or delivery limit; TTL retry queues; parking lot. Queue types: classic (single node, transient or temporary data), quorum (Raft, majority-confirmed, delivery limit; the default for safety), streams (non-destructive log, offsets, replay, super streams); mirrored classic queues removed in 4.0. Ops: 3-node clusters across zones, Khepri metadata, memory and disk alarms block publishers, Prometheus metrics, least-privilege vhost permissions, TLS, topology as code.

Common interview questions

Answer each with a mechanism and an example.

1. Walk through how a message travels from producer to consumer in RabbitMQ.
2. Compare direct, fanout, topic and headers exchanges.
3. What is the difference between auto-ack and manual ack?
4. What does prefetch do, and how would you choose a value?
5. How do publisher confirms differ from consumer acknowledgements?
6. What makes a message survive a broker restart?
7. How do dead-letter exchanges work, and how would you build delayed retries?
8. Classic vs quorum queues vs streams: when would you use each?
9. How do you make consumers safe against duplicate deliveries?
10. When would you choose RabbitMQ over Kafka, and vice versa?

Explain the guarantees end to end

A strong answer traces a message's safety at each hop: outbox to publisher, confirms to broker, quorum replication inside the broker, manual acks and idempotency at the consumer.

Quick check: Which combination gives the strongest guarantee that a published order event is not lost and is processed once in effect?

  • Auto-ack consumers and transient messages
  • Fanout exchange with exclusive queues
  • Classic queues with no confirms
  • Outbox publishing with confirms, persistent messages on a quorum queue, and idempotent consumers with manual acks
Answer

Outbox publishing with confirms, persistent messages on a quorum queue, and idempotent consumers with manual acks — Each hop needs its own safeguard: confirms, replication, manual acks and deduplication.