Kafka MCQs – Kafka Monitoring and Metrics

Monitoring Apache Kafka is essential to ensure the system’s health, reliability, and performance. Kafka exposes internal metrics through JMX, Prometheus, and other tools, which help track broker health, topic throughput, partition lag, consumer group progress, and disk usage. Whether preparing for an interview or working in a production environment, understanding Kafka metrics enables developers and DevOps professionals to maintain a resilient Kafka deployment.

These MCQs are designed to help you crack Kafka interviews and understand real-world monitoring practices from beginner to advanced levels.

1.) Which of the following tools is commonly used to collect and expose Kafka metrics for monitoring?

A) Prometheus
B) JConsole
C) Grafana
D) Nagios

Answer: Option A

Explanation: Prometheus is widely used to scrape metrics from Kafka via exporters or JMX.

2.) Kafka exposes metrics using which Java technology?

A) JavaFX
B) JMX
C) JDBC
D) JMS

Answer: Option B

Explanation: Kafka uses JMX (Java Management Extensions) to expose metrics such as throughput, request latency, and lag.

3.) What is a common tool used with Prometheus to visualize Kafka metrics?

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

Answer: Option C

Explanation: Grafana connects with Prometheus and is used to visualize real-time metrics in dashboards.

4.) Which of the following is a key metric to monitor consumer lag?

A) kafka.request.handler.avg
B) kafka.network.io
C) kafka.consumer.FetchRequestRate
D) kafka.consumer.lag

Answer: Option D

Explanation: This metric tells you how far behind a consumer group is from the producer.

5.) What does the metric BytesInPerSec track?

A) Incoming traffic to a broker
B) Incoming traffic to a broker
C) Message drop rate
D) Controller memory usage

Answer: Option B

Explanation: It measures how much data in bytes a broker receives per second.

6.) kafka.controller.KafkaController

A) kafka.controller.KafkaController
B) kafka.server.BrokerTopicMetrics.MessagesInPerSec
C) kafka.network.RequestMetrics.Produce.TotalTimeMs
D) kafka.network.socket.receive.buffer.bytes

Answer: Option C

Explanation: This metric shows the latency of producing messages to Kafka.

7.) What Kafka metric tracks the number of incoming messages per second?

A) kafka.controller.LeaderElectionRate
B) kafka.controller.LeaderElectionRate
C) kafka.server.BrokerTopicMetrics.MessagesInPerSec
D) kafka.replica.lag

Answer: Option C

Explanation: This metric tells how many messages per second a broker is receiving.

8.) What metric should be monitored to detect under-replicated partitions?

A) kafka.network.receive.buffer.bytes
B) kafka.cluster.PartitionsUnderReplicated
C) kafka.producer.batch.size
D) kafka.journal.flush.interval.ms

Answer: Option B

Explanation: This metric shows the number of partitions with fewer replicas than expected.

9.) In a Kafka Grafana dashboard, what does a high value in UnderReplicatedPartitions signify?

A) High message throughput
B) Disk usage optimization
C) Replica synchronization issue
D) Consumer lag

Answer: Option C

Explanation: Under-replicated partitions mean some followers are out of sync with the leader.

10.) How can Kafka metrics be exposed to Prometheus?

A) Using a JMX exporter
B) Through Kafka REST proxy
C) By enabling XML RPC
D) Through Kafka-Connect plugin

Answer: Option A

Explanation: JMX exporter acts as a bridge between Kafka JMX metrics and Prometheus.

Leave a Reply

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