Q. Which Kafka setting determines how often data is flushed to disk?

  • (A) flush.interval.ms
  • (B) retention.ms
  • (C) log.flush.interval.messages
  • (D) log.retention.check.interval.ms
πŸ’¬ Discuss
βœ… Correct Answer: (C) log.flush.interval.messages
Explanation: log.flush.interval.messages controls how often Kafka flushes data to disk based on message count.

Q. Which Kafka command lists the current consumer groups?

  • (A) kafka-list-groups.sh
  • (B) kafka-consumer-groups.sh --list
  • (C) kafka-consumer-status.sh
  • (D) kafka-topic-groups.sh
πŸ’¬ Discuss
βœ… Correct Answer: (B) kafka-consumer-groups.sh --list
Explanation: kafka-consumer-groups.sh --list lists all the consumer groups in the cluster.

Q. Kafka’s default message compression type is:

  • (A) gzip
  • (B) snappy
  • (C) lz4
  • (D) none
πŸ’¬ Discuss
βœ… Correct Answer: (D) none
Explanation: By default, Kafka does not compress messages unless configured explicitly.

Q. What is the use of the Kafka AdminClient API?

  • (A) Create brokers
  • (B) Manage topics, configurations, and partitions programmatically
  • (C) Consume messages
  • (D) Monitor Kafka memory
πŸ’¬ Discuss
βœ… Correct Answer: (B) Manage topics, configurations, and partitions programmatically
Explanation: The AdminClient API allows administrative actions like topic creation and configuration.

Q. What happens if a Kafka topic does not exist when a producer sends data?

  • (A) Error is thrown
  • (B) Topic is auto-created (if enabled)
  • (C) Producer retries indefinitely
  • (D) Message is redirected to another topic
πŸ’¬ Discuss
βœ… Correct Answer: (B) Topic is auto-created (if enabled)
Explanation: Kafka can auto-create topics if the broker setting allows it.

Q. Which command is used to consume messages from a topic?

  • (A) kafka-topic-reader.sh
  • (B) kafka-console-consumer.sh
  • (C) kafka-message-read.sh
  • (D) kafka-reader.sh
πŸ’¬ Discuss
βœ… Correct Answer: (B) kafka-console-consumer.sh
Explanation: kafka-console-consumer.sh is used to consume and display messages from a topic.

Q. Kafka uses what kind of commit for offset management?

  • (A) Soft commit
  • (B) Durable commit
  • (C) Auto or manual commit
  • (D) Transactional commit only
πŸ’¬ Discuss
βœ… Correct Answer: (C) Auto or manual commit
Explanation: Offsets in Kafka can be committed automatically or manually by consumers.

Q. What does `min.insync.replicas` ensure in Kafka?

  • (A) Minimum consumer threads
  • (B) Minimum replicas that must acknowledge a write
  • (C) Minimum retention time
  • (D) Minimum partition count
πŸ’¬ Discuss
βœ… Correct Answer: (B) Minimum replicas that must acknowledge a write
Explanation: It ensures that a minimum number of in-sync replicas confirm a write for durability.

Q. Kafka is optimized for which type of workloads?

  • (A) Long-term archival
  • (B) High-throughput and low-latency streaming
  • (C) Data warehouse analysis
  • (D) Low-frequency batch updates
πŸ’¬ Discuss
βœ… Correct Answer: (B) High-throughput and low-latency streaming
Explanation: Kafka excels in handling real-time, high-throughput, and low-latency workloads.

Q. What is a Kafka message key used for?

  • (A) Encrypting data
  • (B) Tracking producer IPs
  • (C) Determining the partition for a message
  • (D) Counting offset resets
πŸ’¬ Discuss
βœ… Correct Answer: (C) Determining the partition for a message
Explanation: Kafka uses the message key to determine the partition to which the message should go.