0
0
Kafkadevops~20 mins

Cooperative vs eager rebalancing in Kafka - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Rebalance Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of consumer group rebalance with eager strategy

Consider a Kafka consumer group with two consumers consuming from four partitions. The group uses eager rebalancing. What is the expected behavior during a rebalance when a new consumer joins?

Kafka
Consumer group with 2 consumers consuming 4 partitions.
New consumer joins triggering eager rebalance.
What happens to partition assignment during rebalance?
AAll consumers stop consuming, partitions are revoked from all, then reassigned to all consumers.
BOnly the new consumer starts consuming immediately, others continue without interruption.
CPartitions are reassigned incrementally without stopping any consumer.
DConsumers continue consuming old partitions until manually restarted.
Attempts:
2 left
💡 Hint

Think about how eager rebalancing handles partition revocation and assignment.

Predict Output
intermediate
2:00remaining
Output behavior with cooperative rebalancing

In a Kafka consumer group using cooperative rebalancing, what happens when a new consumer joins the group?

Kafka
Consumer group with 3 consumers consuming 6 partitions.
New consumer joins triggering cooperative rebalance.
What is the behavior during partition reassignment?
APartitions are revoked and reassigned incrementally, allowing consumers to continue processing some partitions without interruption.
BAll partitions are revoked from all consumers before reassignment, causing a full stop.
CNew consumer cannot join until all consumers restart manually.
DPartitions are duplicated temporarily to all consumers during rebalance.
Attempts:
2 left
💡 Hint

Cooperative rebalancing tries to minimize disruption. How does it do that?

🧠 Conceptual
advanced
2:00remaining
Why choose cooperative over eager rebalancing?

Which of the following is the main advantage of cooperative rebalancing compared to eager rebalancing in Kafka consumer groups?

AIt guarantees faster rebalancing by revoking all partitions at once.
BIt requires fewer network resources by disabling partition reassignment.
CIt allows consumers to consume duplicate partitions temporarily.
DIt reduces consumer downtime by allowing incremental partition revocation and assignment.
Attempts:
2 left
💡 Hint

Think about how downtime affects consumer processing.

Predict Output
advanced
2:00remaining
Error raised when using cooperative rebalancing with unsupported client

What error will a Kafka consumer raise if it tries to use cooperative rebalancing but the client library does not support it?

Kafka
KafkaConsumer consumer = new KafkaConsumer(props);
consumer.subscribe(topics, new CooperativeRebalanceListener());
consumer.poll(Duration.ofMillis(100));
Ajava.lang.NullPointerException
Borg.apache.kafka.common.errors.UnsupportedVersionException
Corg.apache.kafka.common.errors.TimeoutException
DNo error, cooperative rebalancing silently falls back to eager
Attempts:
2 left
💡 Hint

Check what happens when a feature is not supported by the Kafka broker or client.

🚀 Application
expert
3:00remaining
Designing a consumer group for minimal downtime during rebalance

You are designing a Kafka consumer group for a critical application that must minimize downtime during rebalances caused by scaling consumers up or down. Which rebalance strategy and configuration should you choose?

AUse eager rebalancing but increase session timeout to delay rebalances.
BUse eager rebalancing with default full partition revocation and assignment.
CUse cooperative rebalancing with incremental partition revocation and assignment enabled.
DDisable rebalancing and manually assign partitions to consumers.
Attempts:
2 left
💡 Hint

Consider which strategy reduces consumer downtime and supports dynamic scaling.