0
0
Kafkadevops~20 mins

Topic deletion and cleanup in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Topic Deletion 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 the Kafka topic deletion command?
Given the command to delete a Kafka topic, what will be the output if the topic exists and deletion is successful?
Kafka
kafka-topics.sh --delete --topic my-topic --bootstrap-server localhost:9092
ATopic 'my-topic' marked for deletion.
BError: Topic 'my-topic' does not exist.
CTopic 'my-topic' deleted immediately.
DWarning: Topic deletion is disabled.
Attempts:
2 left
💡 Hint
Think about how Kafka handles topic deletion asynchronously.
🧠 Conceptual
intermediate
2:00remaining
What happens if topic deletion is disabled in Kafka?
If the Kafka broker configuration has 'delete.topic.enable=false', what will happen when you try to delete a topic?
AThe topic will remain and no deletion occurs.
BThe topic will be marked for deletion but not removed.
CThe deletion command will fail with an error.
DThe topic will be deleted immediately.
Attempts:
2 left
💡 Hint
Consider the effect of disabling topic deletion in Kafka broker settings.
🔧 Debug
advanced
2:00remaining
Why does the topic not get deleted after issuing the delete command?
You ran the command to delete a Kafka topic, but the topic still appears in the list. What could be the reason?
Kafka
kafka-topics.sh --delete --topic test-topic --bootstrap-server localhost:9092
kafka-topics.sh --list --bootstrap-server localhost:9092
AThe topic is marked for deletion but the broker has not completed cleanup yet.
BThe topic name was misspelled in the delete command.
CThe topic has active consumers preventing deletion.
DThe Kafka broker has 'delete.topic.enable' set to false.
Attempts:
2 left
💡 Hint
Check the broker configuration related to topic deletion.
📝 Syntax
advanced
2:00remaining
Which command correctly deletes a Kafka topic named 'orders'?
Choose the correct syntax to delete the Kafka topic 'orders' using kafka-topics.sh with bootstrap server localhost:9092.
Akafka-topics.sh --remove --topic orders --bootstrap-server localhost:9092
Bkafka-topics.sh --delete --topic orders --bootstrap-server localhost:9092
Ckafka-topics.sh --delete-topic orders --server localhost:9092
Dkafka-topics.sh --delete orders --bootstrap-server localhost:9092
Attempts:
2 left
💡 Hint
Check the official kafka-topics.sh command syntax for deleting topics.
🚀 Application
expert
3:00remaining
How to ensure complete cleanup of deleted Kafka topics?
After deleting a Kafka topic, which steps ensure that all data and metadata related to the topic are fully cleaned up from the Kafka cluster?
ARun kafka-topics.sh with --force-delete flag to remove topic instantly.
BRestart all Kafka brokers immediately after issuing the delete command.
CWait for Kafka to asynchronously delete topic data, then manually delete topic directories from brokers if needed.
DDelete the topic and then run kafka-configs.sh to remove topic configs.
Attempts:
2 left
💡 Hint
Think about Kafka's asynchronous deletion and broker storage cleanup.