0
0
Kafkadevops~20 mins

Broker configuration basics in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Broker Configuration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this broker configuration snippet?
Given the following Kafka broker configuration snippet, what will be the value of log.retention.hours after applying it?
Kafka
log.retention.hours=168
log.retention.minutes=10080
ADefault value 168 is used, minutes setting ignored
B10080
CBoth 168 and 10080 are applied, minutes override hours
D168
Attempts:
2 left
💡 Hint
Kafka uses the most specific time unit setting for retention. If both hours and minutes are set, the hours setting takes precedence.
Predict Output
intermediate
2:00remaining
What happens if num.network.threads is set to 0?
Consider this Kafka broker configuration line:
num.network.threads=0
What will happen when the broker starts?
Kafka
num.network.threads=0
ABroker fails to start with a configuration error
BBroker starts but network threads default to 1
CBroker starts but logs a warning and uses 2 network threads
DBroker starts normally with zero network threads
Attempts:
2 left
💡 Hint
Some thread count settings must be positive integers.
🔧 Debug
advanced
3:00remaining
Why does the broker ignore the log.segment.bytes setting?
A user sets the following in server.properties:
log.segment.bytes=1073741824
log.segment.ms=604800000
But the broker still creates log segments smaller than 1GB. What is the most likely reason?
Kafka
log.segment.bytes=1073741824
log.segment.ms=604800000
AThe <code>log.segment.ms</code> setting causes segments to roll over by time before size is reached
BThe <code>log.segment.bytes</code> value is too large and ignored by Kafka
CThe broker requires a restart to apply <code>log.segment.bytes</code>
DThe <code>log.segment.bytes</code> setting must be in MB, not bytes
Attempts:
2 left
💡 Hint
Kafka rolls log segments based on whichever limit is reached first: size or time.
📝 Syntax
advanced
1:30remaining
Which configuration line is syntactically correct for setting broker ID?
Choose the correct syntax to set the broker ID to 5 in server.properties:
Abroker id=5
Bbroker.id:5
Cbroker.id=5
Dbroker.id = 5
Attempts:
2 left
💡 Hint
Kafka configuration uses key=value pairs without spaces around the equals sign.
🚀 Application
expert
2:30remaining
How many log directories will Kafka use with this configuration?
Given this Kafka broker configuration:
log.dirs=/kafka-logs-1,/kafka-logs-2,/kafka-logs-3
How many separate log directories will the broker use to store data?
Kafka
log.dirs=/kafka-logs-1,/kafka-logs-2,/kafka-logs-3
A1
B3
C2
DDepends on the number of partitions
Attempts:
2 left
💡 Hint
Kafka splits partitions across all directories listed in log.dirs.