0
0
Kafkadevops~20 mins

Controller broker in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Controller Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Role of the Controller Broker in Kafka

What is the primary responsibility of the controller broker in a Kafka cluster?

AManaging partition leader elections and cluster metadata updates
BBalancing network traffic between brokers
CStoring all topic data permanently on disk
DServing client requests for producing and consuming messages
Attempts:
2 left
💡 Hint

Think about which broker coordinates cluster-wide decisions.

Predict Output
intermediate
1:00remaining
Controller Broker Leader Election Output

Given the following Kafka controller election log snippet, what will be the output message indicating the new controller?

Kafka
INFO Controller 2 is now the leader for the cluster
AERROR Controller 1 failed to become leader
BINFO Controller 2 is now the leader for the cluster
CWARN Controller 3 lost leadership
DDEBUG Controller election started
Attempts:
2 left
💡 Hint

Look for the message that confirms the new controller leader.

🔧 Debug
advanced
1:30remaining
Identifying Controller Broker Failure Cause

Which of the following log entries indicates a controller broker failure due to session timeout?

AINFO Controller 1 successfully refreshed session
BWARN Controller 2 received heartbeat from broker 3
CERROR Controller 1 session expired, triggering leader election
DDEBUG Controller 3 started election process
Attempts:
2 left
💡 Hint

Look for a message about session expiration or failure.

📝 Syntax
advanced
2:00remaining
Kafka Controller Broker Configuration Syntax

Which of the following is the correct syntax to configure a Kafka broker as a controller candidate in the server.properties file?

Acontroller.quorum.voters=1@broker1:9093,2@broker2:9093,3@broker3:9093
Bcontroller.voters=broker1:9093,broker2:9093,broker3:9093
Ccontroller.broker.ids=1,2,3
Dcontroller.candidates=broker1,broker2,broker3
Attempts:
2 left
💡 Hint

Check the official Kafka configuration property for controller quorum voters.

🚀 Application
expert
2:30remaining
Controller Broker Failover Scenario

In a Kafka cluster with three brokers (1, 2, 3), broker 1 is the current controller. Broker 1 crashes unexpectedly. What is the expected sequence of events for controller failover?

AAll brokers simultaneously try to become controller causing conflict
BBroker 3 immediately takes over without election
CCluster stops processing until broker 1 recovers
DBroker 2 detects broker 1 failure, triggers leader election, becomes new controller
Attempts:
2 left
💡 Hint

Consider how Kafka handles controller failover with leader election.