Kafka MCQs – Kafka in Production & Testing

11.) Which setting ensures producers retry sending failed messages?

A) retries
B) batch.size
C) acks
D) linger.ms

Answer: Option A

Explanation: The retries config allows producers to retry sending messages on failure.

12.) Which open-source dashboard is often used with Kafka and Prometheus?

A) Grafana
B) Kibana
C) Tableau
D) Splunk

Answer: Option A

Explanation: Grafana is a powerful dashboard tool for visualizing Kafka metrics collected by Prometheus.

13.) Which property controls the maximum message size in Kafka?

A) log.message.bytes.max
B) max.message.size
C) message.max.bytes
D) buffer.size

Answer: Option C

Explanation: This sets the upper limit for the size of any message in Kafka.

14.) To test latency in Kafka, which metric should be monitored?

A) request-latency-avg
B) consumer-offset
C) replication.factor
D) broker-id

Answer: Option A

Explanation: Average request latency is a key metric for monitoring Kafka performance.

15.) What is the recommended number of partitions for high-throughput Kafka topics?

A) 1
B) 3
C) 6 or more
D) Unlimited

Answer: Option C

Explanation: More partitions allow higher parallelism but should be planned wisely.

16.) In production, how can you handle Kafka broker failure gracefully?

A) Increase heap size
B) Increase heap size
C) Use fewer topics
D) Ensure replication and use ISR

Answer: Option D

Explanation: Replication and ISR help maintain availability in case of broker failure.

17.) Which CLI command shows Kafka topic details like partition and ISR status?

A) kafka-topic-checker
B) kafka-topics.sh –describe
C) kafka-topic-info
D) kafka-admin status

Answer: Option B

Explanation: This command provides metadata for Kafka topics, including ISR and partitions.

18.) What ensures atomic writes to Kafka topics?

A) Kafka Streams
B) Idempotent producers
C) Kafka ACLs
D) Kafka mirror maker

Answer: Option B

Explanation: Idempotent producers avoid duplicates and ensure write reliability.

19.) What is a good retention policy for a testing Kafka topic?

A) 30 days
B) 7 years
C) 1 hour
D) 1 week

Answer: Option C

Explanation: Testing topics usually have shorter retention to reduce resource usage.

20.) What does acks=0 mean in producer config?

A) No acknowledgment required
B) All replicas must ack
C) Only leader acks
D) Broker acks in batches

Answer: Option A

Explanation: acks=0 gives best performance but no delivery guarantees.

Leave a Reply

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