Challenge - 5 Problems
Kafka Group Coordinator Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Kafka group coordinator state transition?
Consider a Kafka consumer group coordinator handling a rebalance. What will be the final state of the coordinator after the following sequence of events?
Kafka
States: INITIALIZING -> PREPARING_REBALANCE -> COMPLETING_REBALANCE -> STABLE Events: Start -> Prepare -> Complete Transition: INITIALIZING --Start--> PREPARING_REBALANCE PREPARING_REBALANCE --Prepare--> COMPLETING_REBALANCE COMPLETING_REBALANCE --Complete--> STABLE
Attempts:
2 left
💡 Hint
Follow the event sequence step-by-step through the state transitions.
✗ Incorrect
The coordinator moves through each state in order: INITIALIZING to PREPARING_REBALANCE on Start, then to COMPLETING_REBALANCE on Prepare, and finally to STABLE on Complete.
🧠 Conceptual
intermediate1:30remaining
Which component is responsible for managing group membership in Kafka?
In Kafka's group coordinator architecture, which component manages the membership and heartbeat of consumers in a group?
Attempts:
2 left
💡 Hint
Think about which broker handles consumer group coordination.
✗ Incorrect
The Group Coordinator Broker manages group membership, heartbeats, and rebalances for consumer groups.
🔧 Debug
advanced2:00remaining
What error occurs when a consumer fails to send heartbeats to the group coordinator?
Given a Kafka consumer that stops sending heartbeats, what error will the group coordinator raise?
Attempts:
2 left
💡 Hint
Missing heartbeats cause the coordinator to trigger a rebalance.
✗ Incorrect
If a consumer misses heartbeats, the coordinator triggers a rebalance and raises GroupRebalanceInProgressException.
📝 Syntax
advanced2:30remaining
Which option correctly initializes a Kafka group coordinator client in Java?
Select the correct Java code snippet to create a Kafka consumer with a group coordinator configuration.
Kafka
Properties props = new Properties(); props.put("bootstrap.servers", "localhost:9092"); props.put("group.id", "my-group"); props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer"); props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer"); KafkaConsumer<String, String> consumer = ???;
Attempts:
2 left
💡 Hint
Remember to specify generic types when creating the consumer.
✗ Incorrect
The correct syntax requires specifying generic types and passing the properties object to the constructor.
🚀 Application
expert3:00remaining
How many partitions can a Kafka consumer group coordinator assign if the group has 3 consumers and the topic has 10 partitions?
Given a Kafka topic with 10 partitions and a consumer group with 3 consumers, how many partitions will each consumer be assigned if the coordinator uses the default range assignor?
Attempts:
2 left
💡 Hint
The default range assignor distributes partitions as evenly as possible, assigning extra partitions to the first consumers.
✗ Incorrect
With 10 partitions and 3 consumers, the first consumer gets 4 partitions, the others get 3 each.