Quiz2Know

IT

Message Brokers: Apache Kafka & RabbitMQ Internals

Deep dive into messaging architectures, comparing Kafka's distributed commit log against RabbitMQ's AMQP routing model.

This is a free, 16-question multiple-choice quiz. Answer each question to see whether you got it right, with an explanation for every answer. There is no sign-up and no time limit — take it as many times as you like, and scroll down for the full answer key once you are done.

Question 1 of 16

0 correct

What is the foundational architectural difference between Apache Kafka and RabbitMQ?

Press A–D to choose · Enter to submit

Answer key & explanations

Every question in this quiz, with the correct answer marked and an explanation of why it is right. Use it to revise before or after taking the quiz above.

  1. 1.What is the foundational architectural difference between Apache Kafka and RabbitMQ?

    • AKafka is written in Erlang; RabbitMQ is written in Java
    • BKafka is a distributed append-only commit log with consumer-tracked offsets; RabbitMQ is a queue-based broker that tracks message delivery and acknowledgment✓ Correct
    • CKafka only supports synchronous messaging; RabbitMQ only supports asynchronous messaging
    • DRabbitMQ can scale to petabytes per cluster; Kafka is strictly limited to single-node deployments

    Correct answer: Kafka is a distributed append-only commit log with consumer-tracked offsets; RabbitMQ is a queue-based broker that tracks message delivery and acknowledgment

    Kafka acts as a durable, partitioned commit log where consumers manage their own read offsets; RabbitMQ routes messages via exchanges into queues, tracking message states and deleting them once consumed.

  2. 2.In Apache Kafka, what determines message ordering guarantees?

    • AMessages are strictly ordered across the entire cluster globally
    • BMessages are strictly ordered only within a single partition of a topic✓ Correct
    • CMessages are ordered based on the alphabetized client username
    • DOrdering is determined by the consumer's local operating system clock

    Correct answer: Messages are strictly ordered only within a single partition of a topic

    Kafka guarantees strict total ordering only within a single partition; messages written across different partitions within the same topic have no ordering guarantees.

  3. 3.What is an In-Sync Replica (ISR) in Apache Kafka?

    • AA cold standby broker powered down to conserve energy
    • BThe set of partition replicas that are fully caught up with the partition's current leader broker✓ Correct
    • CA backup database situated in a separate geographical region
    • DAn external consumer process that has read all available topic messages

    Correct answer: The set of partition replicas that are fully caught up with the partition's current leader broker

    The ISR is the group of broker replicas that actively follow the partition leader and have caught up with the latest written log offsets within the replica lag threshold.

  4. 4.What does the producer configuration 'acks=all' (or 'acks=-1') guarantee in Apache Kafka?

    • AThe message was successfully received by every consumer group subscribed to the topic
    • BThe partition leader and all current in-sync replicas (ISR) have committed the message to their local logs before acknowledging✓ Correct
    • CThe message has been persisted to non-volatile tape backup storage
    • DThe producer will never retransmit the message even if network errors occur

    Correct answer: The partition leader and all current in-sync replicas (ISR) have committed the message to their local logs before acknowledging

    'acks=all' ensures that the record is acknowledged only after the leader and all active in-sync replicas have committed the write, providing the strongest durability guarantee.

  5. 5.How does RabbitMQ route messages from a producer to a specific queue?

    • AProducers write directly to disk sectors bypassing the broker entirely
    • BProducers publish messages to an Exchange, which routes them to Queues using Bindings and Routing Keys✓ Correct
    • CMessages are distributed strictly round-robin to every queue on the host
    • DRabbitMQ uses DNS lookups on the message payload to locate destination queues

    Correct answer: Producers publish messages to an Exchange, which routes them to Queues using Bindings and Routing Keys

    RabbitMQ uses an AMQP exchange-centric model: producers publish to an Exchange (direct, topic, fanout, headers), which directs messages to bound queues based on routing keys.

  6. 6.What is the function of a RabbitMQ Fanout Exchange?

    • AIt routes messages based on complex regular expression pattern matching
    • BIt duplicates and broadcasts incoming messages to all queues bound to it, ignoring routing keys entirely✓ Correct
    • CIt rejects messages that exceed 64 kilobytes in size
    • DIt drops messages if downstream consumer memory usage exceeds 80%

    Correct answer: It duplicates and broadcasts incoming messages to all queues bound to it, ignoring routing keys entirely

    A fanout exchange ignores routing keys and blindly broadcasts copies of received messages to every queue currently bound to that exchange (publish-subscribe pattern).

  7. 7.What Linux kernel system call enables Kafka's zero-copy message delivery mechanism?

    • Afork()
    • Bsendfile()✓ Correct
    • Cepoll_wait()
    • Dptrace()

    Correct answer: sendfile()

    Kafka uses the sendfile() system call to transfer page cache data directly to the network socket, avoiding copying data into user-space memory and saving CPU cycles.

  8. 8.What happens when a Kafka consumer group experiences a 'rebalance'?

    • AAll consumer processes are terminated and restarted from scratch
    • BThe group coordinator reallocates topic partition assignments among the active consumers in the group✓ Correct
    • CKafka recalculates the floating-point hash of all stored messages
    • DThe cluster leader redistributes disk sectors across all physical brokers

    Correct answer: The group coordinator reallocates topic partition assignments among the active consumers in the group

    A consumer rebalance occurs when consumers join, leave, or fail, prompting the group coordinator to reassign topic partition ownership across surviving group members.

  9. 9.What is the role of the KRaft protocol in modern Apache Kafka clusters?

    • AIt encrypts message payloads using post-quantum cryptography
    • BIt replaces the external Apache ZooKeeper dependency with an integrated Raft consensus mechanism for metadata management✓ Correct
    • CIt connects Kafka brokers directly to Kubernetes cluster APIs
    • DIt compiles Java producer code into native C++ binaries

    Correct answer: It replaces the external Apache ZooKeeper dependency with an integrated Raft consensus mechanism for metadata management

    KRaft (Kafka Raft Metadata mode) replaces external ZooKeeper clusters with a built-in Raft consensus quorum, improving scalability, partition recovery times, and cluster operations.

  10. 10.How does RabbitMQ handle Consumer Prefetch (QoS)?

    • AIt caches messages on the client's local disk drive
    • BIt limits the number of unacknowledged messages the broker sends to a consumer before waiting for acknowledgments✓ Correct
    • CIt prioritizes consumers with the fastest network connections
    • DIt enforces a hard cap on the size of queue payloads

    Correct answer: It limits the number of unacknowledged messages the broker sends to a consumer before waiting for acknowledgments

    Basic.qos prefetch limits the number of unacknowledged messages in flight on a channel, preventing consumers from being overwhelmed and ensuring fair distribution across workers.

  11. 11.What mechanism does Kafka use to remove old data and control log sizes on disk?

    • AExecuting SQL DROP TABLE statements on historical files
    • BLog retention policies based on time or size limits, and Log Compaction based on record keys✓ Correct
    • CCompressing historical partitions into encrypted ZIP files
    • DDeleting messages immediately after the first consumer reads them

    Correct answer: Log retention policies based on time or size limits, and Log Compaction based on record keys

    Kafka purges data based on time (log.retention.hours) or size limits, or uses Log Compaction to retain the single most recent record for each key.

  12. 12.In RabbitMQ, what is a Dead Letter Exchange (DLX)?

    • AAn exchange that has been permanently retired and deleted by administrators
    • BAn exchange to which messages are automatically routed if they are rejected (nack), expire due to TTL, or exceed queue lengths✓ Correct
    • CA cluster router dedicated strictly to handling encrypted financial transactions
    • DA backup exchange located in an alternate data center

    Correct answer: An exchange to which messages are automatically routed if they are rejected (nack), expire due to TTL, or exceed queue lengths

    A DLX captures messages that fail consumption, expire due to TTL, or are dropped from full queues, rerouting them to dedicated analysis queues.

  13. 13.What does Kafka's Idempotent Producer guarantee?

    • AMessages sent by the producer are delivered to all consumer groups in under one millisecond
    • BNetwork retries by the producer will not introduce duplicate messages into a topic partition✓ Correct
    • CThe producer will reject any message that contains duplicate text in its payload
    • DProducer code will execute identically on any operating system

    Correct answer: Network retries by the producer will not introduce duplicate messages into a topic partition

    With enable.idempotence=true, Kafka assigns a Producer ID and sequence numbers to records, allowing brokers to identify and discard duplicate messages sent during network retries.

  14. 14.What is a Quorum Queue in modern RabbitMQ?

    • AA queue that distributes tasks using round-robin round-table algorithms
    • BA durable, replicated FIFO queue based on the Raft consensus algorithm that replaces legacy mirrored queues✓ Correct
    • CA queue that requires five human approvals before releasing messages
    • DAn in-memory-only queue designed for ultra-high throughput ephemeral caching

    Correct answer: A durable, replicated FIFO queue based on the Raft consensus algorithm that replaces legacy mirrored queues

    Quorum Queues implement the Raft consensus algorithm, providing stronger data safety, fault tolerance, and predictable recovery compared to legacy mirrored queues.

  15. 15.What happens if a Kafka consumer sets 'enable.auto.commit=true' and encounters an uncaught processing exception?

    • AThe broker automatically halts the entire topic partition
    • BThe offset may be committed before the record was successfully handled, leading to message loss on consumer restart✓ Correct
    • CKafka triggers an immediate rollback of the consumer group's state
    • DThe consumer thread is permanently converted into a producer thread

    Correct answer: The offset may be committed before the record was successfully handled, leading to message loss on consumer restart

    Auto-commit writes offsets periodically regardless of processing success; if a failure occurs between read and write, unhandled messages are skipped upon restart, causing data loss.

  16. 16.What is a Compacted Topic in Apache Kafka primarily used for?

    • AArchiving raw text messages into gzipped tar archives
    • BMaintaining the latest known state for every unique message key, functioning like a durable change-log table✓ Correct
    • CDeleting all messages older than sixty seconds automatically
    • DConverting JSON messages into binary Protobuf formats

    Correct answer: Maintaining the latest known state for every unique message key, functioning like a durable change-log table

    Log compaction keeps the latest value for every key in the partition log, allowing applications to restore point-in-time state tables (like KTables) upon cold start.

More free quizzes