Kafka MCQs – Kafka in Production & Testing

21.) Which Kafka tool can be used for performance testing?

A) kafka-producer-perf-test.sh
B) kafka-load-runner.sh
C) kafka-monitor.sh
D) kafka-consumer-perf-test.sh

Answer: Option A

Explanation: This tool helps test Kafka producer performance under various loads.

22.) What is the best practice for log retention in a production Kafka setup?

A) Set it to 1 hour
B) Infinite retention
C) Based on business requirements
D) 7 years for audit

Answer: Option C

Explanation: Retention should align with business needs and storage limits.

23.) In testing, how can you validate a Kafka topic received all expected messages?

A) Count messages manually
B) Use Kafka Connect
C) Check broker logs
D) Consume from topic and validate count

Answer: Option D

Explanation: You can create a temporary consumer group and compare counts.

24.) Which command is used to consume messages from the beginning?

A) –reset-offset
B) –from-earliest
C) –seek=0
D) –read-all

Answer: Option B

Explanation: This tells the consumer to start reading from the oldest available message.

25.) Which Kafka configuration helps reduce disk usage?

A) log.retention.bytes
B) message.timeout.ms
C) acks=0
D) buffer.size

Answer: Option A

Explanation: This restricts total log size per topic partition.

Leave a Reply

Your email address will not be published. Required fields are marked *