0
0
Kafkadevops~20 mins

Kafka installation and setup - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Setup 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 Kafka console producer command?
You run the following command to send a message to a Kafka topic named test-topic. What will be the output shown in the terminal after sending the message?
Kafka
echo "Hello Kafka" | kafka-console-producer.sh --broker-list localhost:9092 --topic test-topic
AError: Topic 'test-topic' does not exist
BProducer started, waiting for input
CMessage sent successfully with no output
DHello Kafka
Attempts:
2 left
💡 Hint
The console producer command sends the message silently unless there is an error.
🧠 Conceptual
intermediate
1:30remaining
Which service must be running before starting Kafka broker?
Before starting the Kafka broker, which service must be running to ensure Kafka works properly?
AZookeeper
BKafka Connect
CKafka Streams
DKafka Producer
Attempts:
2 left
💡 Hint
Kafka uses this service to manage cluster metadata and leader election.
🔧 Debug
advanced
2:30remaining
Why does Kafka broker fail to start with this error?
You try to start Kafka broker but get this error: ERROR Fatal error during KafkaServer startup. The logs show Port 9092 already in use. What is the most likely cause?
Kafka
bin/kafka-server-start.sh config/server.properties
AZookeeper is not running
BAnother Kafka broker or process is already using port 9092
CThe server.properties file is missing
DKafka version is incompatible with Java version
Attempts:
2 left
💡 Hint
Check if any other process is using the default Kafka port.
📝 Syntax
advanced
2:00remaining
Which command correctly creates a Kafka topic named 'orders' with 3 partitions?
Select the correct command to create a Kafka topic named orders with 3 partitions and a replication factor of 1.
Akafka-topics.sh --create --topic orders --partitions 3 --replication-factor 1 --bootstrap-server localhost:9092
Bkafka-topics.sh --create --topic orders --partition 3 --replication 1 --zookeeper localhost:2181
Ckafka-topics.sh --create --topic orders --partitions=3 --replication-factor=1 --bootstrap-server localhost:9092
Dkafka-topics.sh --create orders --partitions 3 --replication-factor 1 --bootstrap-server localhost:9092
Attempts:
2 left
💡 Hint
Check the exact option names and syntax for partitions and replication factor.
🚀 Application
expert
3:00remaining
How to configure Kafka broker to listen on all network interfaces?
You want your Kafka broker to accept connections from any IP address on your machine. Which configuration setting in server.properties achieves this?
Aadvertised.listeners=PLAINTEXT://0.0.0.0:9092
Badvertised.listeners=PLAINTEXT://localhost:9092
Clisteners=PLAINTEXT://127.0.0.1:9092
Dlisteners=PLAINTEXT://0.0.0.0:9092
Attempts:
2 left
💡 Hint
The listeners setting controls where Kafka binds to accept connections.