Q. What is a 'consumer lag' in Kafka?

  • (A) Time taken to produce a message
  • (B) Time difference between brokers
  • (C) The gap between last produced and last consumed offset
  • (D) Offset of earliest message
πŸ’¬ Discuss
βœ… Correct Answer: (C) The gap between last produced and last consumed offset
Explanation: Consumer lag shows how far behind the consumer is compared to the producer.

Q. Kafka guarantees message delivery to consumers at which level?

  • (A) At-most-once
  • (B) At-least-once
  • (C) Exactly-once by default
  • (D) Never
πŸ’¬ Discuss
βœ… Correct Answer: (B) At-least-once
Explanation: Kafka by default ensures at-least-once message delivery.

Q. What does Kafka use to monitor health and performance?

  • (A) Kafka Monitor
  • (B) Kafka Streams
  • (C) ZooKeeper logs
  • (D) Kafka Firewall
πŸ’¬ Discuss
βœ… Correct Answer: (A) Kafka Monitor
Explanation: Kafka Monitor is used to measure performance and monitor the health of Kafka clusters.

Q. What happens when a consumer commits an offset?

  • (A) Message is deleted
  • (B) Kafka sends an acknowledgment to producer
  • (C) Consumer saves progress for future restarts
  • (D) Topic is paused
πŸ’¬ Discuss
βœ… Correct Answer: (C) Consumer saves progress for future restarts
Explanation: Offset committing helps consumers resume from the correct position after a restart.

Q. Kafka uses what data structure for storing messages?

  • (A) Queue
  • (B) Hash Table
  • (C) Array
  • (D) Log
πŸ’¬ Discuss
βœ… Correct Answer: (D) Log
Explanation: Kafka uses a log structure to store messages sequentially on disk.

Q. Kafka uses ZooKeeper for all except:

  • (A) Cluster coordination
  • (B) Broker registration
  • (C) Offset storage in new versions
  • (D) Leader election
πŸ’¬ Discuss
βœ… Correct Answer: (C) Offset storage in new versions
Explanation: Kafka has moved offset storage to Kafka itself instead of using ZooKeeper in newer versions.

Q. Which Kafka version introduced KRaft (Kafka Raft Metadata mode)?

  • (A) 2.2
  • (B) 2.6
  • (C) 2.8
  • (D) 3.0
πŸ’¬ Discuss
βœ… Correct Answer: (D) 3.0
Explanation: Kafka 3.0 introduced KRaft to remove dependency on ZooKeeper.

Q. What is the main benefit of Kafka's partitioning model?

  • (A) Reduces disk usage
  • (B) Increases security
  • (C) Enables scalability and parallelism
  • (D) Simplifies configuration
πŸ’¬ Discuss
βœ… Correct Answer: (C) Enables scalability and parallelism
Explanation: Partitioning allows Kafka to scale horizontally and enables parallel processing by consumers.

Q. Which Kafka client API is used to write messages to topics?

  • (A) Consumer API
  • (B) Producer API
  • (C) Streams API
  • (D) Connect API
πŸ’¬ Discuss
βœ… Correct Answer: (B) Producer API
Explanation: The Producer API is used to send data to Kafka topics.

Q. What does the 'linger.ms' configuration do in Kafka producer?

  • (A) Sets how long to wait before retrying
  • (B) Delays the request to allow batching
  • (C) Determines the message retention time
  • (D) Configures consumer delay
πŸ’¬ Discuss
βœ… Correct Answer: (B) Delays the request to allow batching
Explanation: 'linger.ms' defines the maximum time to wait before sending a batch of records.