Q. Kafka’s load balancing across consumers is handled by:

  • (A) Producer routing
  • (B) Broker configuration
  • (C) Consumer group coordinator
  • (D) Topic settings
πŸ’¬ Discuss
βœ… Correct Answer: (C) Consumer group coordinator
Explanation: The consumer group coordinator assigns partitions among consumers.

Q. Kafka uses ZooKeeper for:

  • (A) Data retention
  • (B) Topic storage
  • (C) Cluster metadata and leader election
  • (D) Message encryption
πŸ’¬ Discuss
βœ… Correct Answer: (C) Cluster metadata and leader election
Explanation: ZooKeeper manages broker metadata and leader elections.

Q. Kafka 2.8.0 introduced the option to:

  • (A) Use PostgreSQL as a backend
  • (B) Remove ZooKeeper dependency
  • (C) Disable replication
  • (D) Use REST APIs only
πŸ’¬ Discuss
βœ… Correct Answer: (B) Remove ZooKeeper dependency
Explanation: Kafka 2.8.0 introduced an early version of KRaft mode to eliminate ZooKeeper.

Q. What is the role of the Kafka producer API?

  • (A) To consume messages
  • (B) To process streams
  • (C) To send records to Kafka topics
  • (D) To store offsets
πŸ’¬ Discuss
βœ… Correct Answer: (C) To send records to Kafka topics
Explanation: The Kafka producer API is used to publish records to Kafka topics.

Q. What is Kafka’s default message format?

  • (A) XML
  • (B) Plain text
  • (C) Key-value pairs
  • (D) CSV
πŸ’¬ Discuss
βœ… Correct Answer: (C) Key-value pairs
Explanation: Kafka messages are in key-value pair format, both are byte arrays.

Q. What does ISR stand for in Kafka?

  • (A) In-Sync Replicas
  • (B) Internal Stream Routing
  • (C) Indexed Segment Records
  • (D) Input Stream Routing
πŸ’¬ Discuss
βœ… Correct Answer: (A) In-Sync Replicas
Explanation: ISR (In-Sync Replicas) are replicas that are fully caught up with the leader.

Q. What ensures message durability in Kafka?

  • (A) Replication factor
  • (B) Broker ID
  • (C) Consumer lag
  • (D) Compression type
πŸ’¬ Discuss
βœ… Correct Answer: (A) Replication factor
Explanation: Higher replication factor ensures data is not lost if a broker fails.

Q. Kafka’s leader election is handled by:

  • (A) Producer
  • (B) ZooKeeper or KRaft controller
  • (C) Consumer
  • (D) Connect API
πŸ’¬ Discuss
βœ… Correct Answer: (B) ZooKeeper or KRaft controller
Explanation: Leader election is handled by ZooKeeper or KRaft in newer versions.

Q. Which setting controls how often the producer sends batches?

  • (A) batch.size
  • (B) linger.ms
  • (C) compression.type
  • (D) acks
πŸ’¬ Discuss
βœ… Correct Answer: (B) linger.ms
Explanation: linger.ms sets how long the producer waits before sending a batch.

Q. Kafka stores consumer offsets in:

  • (A) ZooKeeper only
  • (B) Producer logs
  • (C) Kafka topic __consumer_offsets
  • (D) Partitions
πŸ’¬ Discuss
βœ… Correct Answer: (C) Kafka topic __consumer_offsets
Explanation: Consumer offsets are stored in a special internal Kafka topic called __consumer_offsets.