Challenge - 5 Problems
Kafka CLI Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of the kafka-topics.sh command?
You run the command
kafka-topics.sh --list --bootstrap-server localhost:9092 on a Kafka cluster with three topics: orders, payments, and shipments. What will be the output?Kafka
kafka-topics.sh --list --bootstrap-server localhost:9092
Attempts:
2 left
💡 Hint
The --list option shows all existing topics in the cluster.
✗ Incorrect
The kafka-topics.sh tool with --list option lists all topics currently in the Kafka cluster. Since there are three topics, their names are printed line by line.
❓ Predict Output
intermediate2:00remaining
What does kafka-console-producer.sh output after sending a message?
You run
kafka-console-producer.sh --broker-list localhost:9092 --topic test and type the message Hello Kafka. What output do you see immediately after pressing Enter?Kafka
kafka-console-producer.sh --broker-list localhost:9092 --topic testAttempts:
2 left
💡 Hint
The console producer does not print confirmation messages after sending.
✗ Incorrect
The kafka-console-producer.sh tool sends messages to Kafka but does not print any confirmation or echo the message. It just waits for the next input.
❓ Predict Output
advanced2:00remaining
What is the output of kafka-consumer-groups.sh --describe?
You run
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group my-group --describe and the group has one member consuming from topic orders partition 0 with lag 5. What output do you expect?Kafka
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group my-group --describeAttempts:
2 left
💡 Hint
The --describe option shows detailed info including lag.
✗ Incorrect
The kafka-consumer-groups.sh tool with --describe prints a table with group, topic, partition, offsets, lag, and consumer details. Since lag is 5, it is shown in the output.
❓ Predict Output
advanced2:00remaining
What error does kafka-configs.sh produce with invalid syntax?
You run
kafka-configs.sh --alter --entity-type topics --entity-name my-topic --add-config retention.ms=abc --bootstrap-server localhost:9092. What error will you see?Kafka
kafka-configs.sh --alter --entity-type topics --entity-name my-topic --add-config retention.ms=abc --bootstrap-server localhost:9092Attempts:
2 left
💡 Hint
retention.ms expects a number in milliseconds.
✗ Incorrect
The kafka-configs.sh tool validates config values. Since retention.ms expects a numeric value, passing 'abc' causes an invalid value error.
🧠 Conceptual
expert2:00remaining
Which Kafka CLI tool is used to reset consumer group offsets?
You want to move the offsets of a consumer group backward to reprocess messages. Which Kafka CLI tool and option do you use?
Attempts:
2 left
💡 Hint
Resetting offsets is done via the consumer groups tool.
✗ Incorrect
The kafka-consumer-groups.sh tool supports the --reset-offsets option to change offsets for a consumer group to a specific point.