0
0
Microservicessystem_design~20 mins

Message brokers (Kafka, RabbitMQ) in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Message Broker Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Message Broker Roles

Which of the following best describes the primary role of a message broker like Kafka or RabbitMQ in a microservices architecture?

AIt facilitates asynchronous communication by routing messages between services.
BIt directly processes user requests and returns responses synchronously.
CIt stores large files and serves them to clients on demand.
DIt manages database transactions and ensures ACID compliance.
Attempts:
2 left
💡 Hint

Think about how services talk to each other without waiting for immediate replies.

Architecture
intermediate
2:30remaining
Choosing Between Kafka and RabbitMQ

You need to design a system that processes a high volume of streaming data with strict ordering guarantees. Which message broker is more suitable and why?

AKafka, because it is optimized for high-throughput, ordered, and durable event streaming.
BKafka, because it uses push-based delivery to consumers for low latency.
CRabbitMQ, because it stores messages on disk for long-term archival.
DRabbitMQ, because it supports complex routing and flexible message patterns.
Attempts:
2 left
💡 Hint

Consider which broker is designed for streaming large volumes of ordered data efficiently.

scaling
advanced
3:00remaining
Scaling Message Brokers for High Availability

Which approach best ensures high availability and fault tolerance in a Kafka cluster?

AUse RabbitMQ instead because Kafka cannot replicate data.
BUse multiple Kafka brokers with replication factor greater than one for each partition.
CDeploy a single Kafka broker with multiple partitions on one server.
DDisable replication and rely on client retries to handle failures.
Attempts:
2 left
💡 Hint

Think about how Kafka keeps copies of data to survive broker failures.

tradeoff
advanced
3:00remaining
Tradeoffs Between Push and Pull Messaging Models

RabbitMQ uses a push model to deliver messages to consumers, while Kafka uses a pull model. What is a key tradeoff of the pull model used by Kafka?

APull model reduces consumer control over message flow, causing overload.
BPull model increases latency because consumers must request messages actively.
CPull model allows consumers to control consumption rate, improving backpressure handling.
DPull model requires brokers to maintain consumer state, increasing complexity.
Attempts:
2 left
💡 Hint

Consider how consumers manage message flow and avoid being overwhelmed.

estimation
expert
4:00remaining
Estimating Kafka Cluster Capacity

You expect to handle 30,000 messages per second, each 1 KB in size, with a replication factor of 3 and retention of 7 days. Approximately how much storage capacity (in TB) should your Kafka cluster have to store all replicas?

AAbout 18 TB
BAbout 1.8 TB
CAbout 378 TB
DAbout 54 TB
Attempts:
2 left
💡 Hint

Calculate total data per day, multiply by retention days and replication factor, then convert to TB.