Bird
Raised Fist0
RabbitMQdevops~20 mins

RabbitMQ vs Kafka comparison - Practice Questions

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Messaging Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Primary Messaging Model Difference
What is the main difference in the messaging model between RabbitMQ and Kafka?
ARabbitMQ uses a push-based queue system; Kafka uses a pull-based log system.
BRabbitMQ stores messages permanently; Kafka deletes messages immediately after consumption.
CRabbitMQ requires consumers to poll for messages; Kafka pushes messages to consumers.
DRabbitMQ and Kafka both use the same push-based queue system.
Attempts:
2 left
💡 Hint
Think about how each system delivers messages to consumers.
🧠 Conceptual
intermediate
2:00remaining
Message Durability and Retention
Which statement correctly describes message durability and retention differences between RabbitMQ and Kafka?
ARabbitMQ retains messages indefinitely; Kafka deletes messages after consumption.
BBoth RabbitMQ and Kafka delete messages immediately after delivery.
CKafka retains messages based on time or size regardless of consumption; RabbitMQ deletes messages once acknowledged.
DRabbitMQ and Kafka both retain messages permanently until manually deleted.
Attempts:
2 left
💡 Hint
Consider how each system handles message storage after consumers read them.
🔀 Workflow
advanced
3:00remaining
Configuring High Availability
Which configuration correctly sets up high availability in RabbitMQ using mirrored queues?
RabbitMQ
rabbitmqctl set_policy ha-all ".*" '{"ha-mode":"all"}'
Arabbitmqctl set_policy ha-all "^" '{"ha-mode":"exactly", "ha-params":2}'
Brabbitmqctl set_policy ha-all "^" '{"ha-mode":"all"}'
Crabbitmqctl set_policy ha-all "^" '{"ha-mode":"nodes"}'
Drabbitmqctl set_policy ha-all ".*" '{"ha-mode":"all"}'
Attempts:
2 left
💡 Hint
The pattern ".*" matches all queues for mirroring.
❓ Troubleshoot
advanced
2:30remaining
Diagnosing Kafka Consumer Lag
You notice that Kafka consumers are lagging behind the latest messages. Which is the most likely cause?
AConsumers are too slow or overwhelmed, causing them to fall behind the log end offset.
BKafka brokers have deleted messages before consumers read them.
CRabbitMQ queues are full, blocking message delivery.
DProducers are sending messages too slowly.
Attempts:
2 left
💡 Hint
Lag means consumers are behind the latest messages in Kafka.
✅ Best Practice
expert
3:00remaining
Choosing Between RabbitMQ and Kafka for Event Streaming
For a system requiring high throughput event streaming with message replay capability, which is the best choice and why?
ARabbitMQ, because it pushes messages immediately and deletes them after consumption for faster processing.
BKafka, because it stores messages in a durable log allowing replay and handles high throughput efficiently.
CRabbitMQ, because it supports message replay by default through mirrored queues.
DKafka, because it deletes messages immediately after delivery to save storage.
Attempts:
2 left
💡 Hint
Think about replay and throughput capabilities.

Practice

(1/5)
1. Which messaging system uses queues and exchanges to route messages?
easy
A. RabbitMQ
B. Kafka
C. Both RabbitMQ and Kafka
D. Neither RabbitMQ nor Kafka

Solution

  1. Step 1: Understand RabbitMQ architecture

    RabbitMQ uses queues and exchanges to route messages flexibly between producers and consumers.
  2. Step 2: Compare with Kafka

    Kafka uses topics and partitions, not queues and exchanges, for streaming data.
  3. Final Answer:

    RabbitMQ -> Option A
  4. Quick Check:

    Queues and exchanges = RabbitMQ [OK]
Hint: Queues and exchanges belong to RabbitMQ architecture [OK]
Common Mistakes:
  • Confusing Kafka's topics with RabbitMQ queues
  • Thinking both use the same routing method
  • Assuming Kafka uses exchanges
2. Which of the following is the correct term used by Kafka for organizing messages?
easy
A. Channels
B. Queues
C. Exchanges
D. Topics

Solution

  1. Step 1: Identify Kafka's message organization

    Kafka organizes messages into topics, which are further divided into partitions.
  2. Step 2: Eliminate other terms

    Exchanges and queues are RabbitMQ terms; channels are not used for message organization in Kafka.
  3. Final Answer:

    Topics -> Option D
  4. Quick Check:

    Kafka uses topics for messages [OK]
Hint: Kafka organizes messages into topics, not queues or exchanges [OK]
Common Mistakes:
  • Mixing RabbitMQ terms with Kafka
  • Choosing queues or exchanges for Kafka
  • Confusing channels with topics
3. Given a scenario where you need fast, ordered streaming of large volumes of data, which system is best suited?
medium
A. Kafka
B. RabbitMQ
C. Both RabbitMQ and Kafka equally
D. Neither RabbitMQ nor Kafka

Solution

  1. Step 1: Analyze the requirement for fast, ordered streaming

    Kafka is designed for high-throughput, ordered streaming of large data volumes using topics and partitions.
  2. Step 2: Compare RabbitMQ's use case

    RabbitMQ is better for complex routing and workflows, not optimized for big data streaming.
  3. Final Answer:

    Kafka -> Option A
  4. Quick Check:

    Fast ordered streaming = Kafka [OK]
Hint: Big data streaming with order? Choose Kafka [OK]
Common Mistakes:
  • Choosing RabbitMQ for big data streaming
  • Assuming both perform equally for streaming
  • Ignoring Kafka's partitioning advantage
4. You see a system using exchanges and queues but experiencing slow message throughput. What is a likely cause?
medium
A. Using Kafka with wrong topic partitions
B. Using RabbitMQ but not enabling message persistence
C. Using RabbitMQ for complex workflows without tuning
D. Using Kafka with too many consumers

Solution

  1. Step 1: Identify the system components

    Exchanges and queues indicate RabbitMQ is used.
  2. Step 2: Understand throughput issues in RabbitMQ

    RabbitMQ for complex workflows without tuning (e.g., prefetch, queue TTLs) leads to resource contention and slow throughput.
  3. Final Answer:

    Using RabbitMQ for complex workflows without tuning -> Option C
  4. Quick Check:

    Exchanges/queues slow = RabbitMQ untuned [OK]
Hint: Slow RabbitMQ with exchanges/queues? Tune complex workflows [OK]
Common Mistakes:
  • Confusing Kafka terms with RabbitMQ
  • Blaming persistence instead of tuning
  • Ignoring RabbitMQ tuning options
5. You need to design a system for complex message routing with multiple consumers and guaranteed delivery. Which system and feature combination is best?
hard
A. Kafka with topics and partitions
B. RabbitMQ with exchanges and queues
C. Kafka with consumer groups only
D. RabbitMQ with direct connections only

Solution

  1. Step 1: Understand requirements for complex routing and guaranteed delivery

    RabbitMQ supports flexible routing via exchanges and queues and offers message acknowledgments for delivery guarantees.
  2. Step 2: Compare Kafka's features

    Kafka is optimized for streaming and partitions but less flexible for complex routing workflows.
  3. Final Answer:

    RabbitMQ with exchanges and queues -> Option B
  4. Quick Check:

    Complex routing + guaranteed delivery = RabbitMQ exchanges/queues [OK]
Hint: Complex routing needs RabbitMQ exchanges and queues [OK]
Common Mistakes:
  • Choosing Kafka for complex routing
  • Ignoring RabbitMQ's delivery guarantees
  • Assuming direct connections handle routing
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard