0
0
Kafkadevops~20 mins

Broker nodes in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Broker Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary role of a Kafka broker node?

In a Kafka cluster, what is the main job of a broker node?

AReceive messages from producers, store them, and serve to consumers
BManage the cluster's Zookeeper ensemble
COnly produce messages to topics
DHandle client authentication exclusively
Attempts:
2 left
💡 Hint

Think about where messages are kept and how clients get them.

Predict Output
intermediate
1:30remaining
What output does this Kafka broker configuration produce?

Given this Kafka broker configuration snippet, what will be the broker's advertised listener port?

Kafka
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://broker1.example.com:9094
A9094
B9092
C0.0.0.0
Dbroker1.example.com
Attempts:
2 left
💡 Hint

Advertised listeners tell clients how to connect.

🔧 Debug
advanced
2:00remaining
Why does this Kafka broker fail to start?

Examine the following Kafka broker configuration snippet. Why will the broker fail to start?

Kafka
broker.id=1
listeners=PLAINTEXT://:9092
advertised.listeners=PLAINTEXT://localhost:9092
log.dirs=/tmp/kafka-logs
Alog.dirs path is invalid
Bbroker.id must be zero or greater
Clisteners missing hostname causes startup failure
Dadvertised.listeners cannot use localhost
Attempts:
2 left
💡 Hint

Check the listeners setting format carefully.

📝 Syntax
advanced
1:30remaining
Which option correctly defines multiple listeners for a Kafka broker?

Choose the correct syntax to configure two listeners: one PLAINTEXT on port 9092 and one SSL on port 9093.

Alisteners=PLAINTEXT://0.0.0.0:9092;SSL://0.0.0.0:9093
Blisteners=PLAINTEXT://0.0.0.0:9092,SSL://0.0.0.0:9093
Clisteners=[PLAINTEXT://0.0.0.0:9092, SSL://0.0.0.0:9093]
Dlisteners=PLAINTEXT://0.0.0.0:9092 SSL://0.0.0.0:9093
Attempts:
2 left
💡 Hint

Multiple listeners are separated by commas.

🚀 Application
expert
2:30remaining
How many partitions will broker 2 host after this assignment?

Given a Kafka cluster with 3 brokers (IDs 1, 2, 3) and a topic with 6 partitions assigned as follows:

  • Partition 0: leader=1, replicas=[1,2]
  • Partition 1: leader=2, replicas=[2,3]
  • Partition 2: leader=3, replicas=[3,1]
  • Partition 3: leader=1, replicas=[1,3]
  • Partition 4: leader=2, replicas=[2,1]
  • Partition 5: leader=3, replicas=[3,2]

How many partitions does broker 2 host (as leader or replica)?

A5
B3
C6
D4
Attempts:
2 left
💡 Hint

Count all partitions where broker 2 is either leader or in replicas.