Q. Which setting in the Kafka producer ensures delivery of messages without duplication?

  • (A) acks=0
  • (B) enable.idempotence=true
  • (C) retries=0
  • (D) linger.ms=0
πŸ’¬ Discuss
βœ… Correct Answer: (B) enable.idempotence=true
Explanation: Setting 'enable.idempotence=true' ensures no duplicate messages are produced.

Q. What is a dead-letter queue (DLQ) in Kafka?

  • (A) A queue for unused topics
  • (B) A queue for messages that failed processing
  • (C) A queue with outdated logs
  • (D) A queue of empty messages
πŸ’¬ Discuss
βœ… Correct Answer: (B) A queue for messages that failed processing
Explanation: A DLQ stores messages that cannot be processed after several attempts.

Q. Kafka is highly available due to:

  • (A) Consumer buffering
  • (B) Replication of partitions
  • (C) Use of REST API
  • (D) Limiting consumer offset
πŸ’¬ Discuss
βœ… Correct Answer: (B) Replication of partitions
Explanation: Kafka maintains high availability through replication of partitions across brokers.

Q. Kafka works best in which type of architecture?

  • (A) Peer-to-peer
  • (B) Client-server
  • (C) Microservices and event-driven
  • (D) Monolithic
πŸ’¬ Discuss
βœ… Correct Answer: (C) Microservices and event-driven
Explanation: Kafka excels in microservices and event-driven architectures for real-time data flow.

Q. What does Kafka use to serialize and deserialize data?

  • (A) XML
  • (B) Protocol Buffers
  • (C) Serializer and Deserializer interfaces
  • (D) INI files
πŸ’¬ Discuss
βœ… Correct Answer: (C) Serializer and Deserializer interfaces
Explanation: Kafka uses configurable serializers and deserializers to handle data formats.

Q. Which one is a common message format used with Kafka?

  • (A) PDF
  • (B) CSV
  • (C) JSON
  • (D) JPEG
πŸ’¬ Discuss
βœ… Correct Answer: (C) JSON
Explanation: JSON is a popular format for Kafka message payloads due to its flexibility and readability.

Q. Which of the following is true about Kafka's log compaction?

  • (A) Deletes all messages older than 24 hours
  • (B) Keeps only the latest message for each key
  • (C) Encrypts log segments
  • (D) Compresses logs in real-time
πŸ’¬ Discuss
βœ… Correct Answer: (B) Keeps only the latest message for each key
Explanation: Log compaction retains the most recent value for each key, allowing efficient updates.

Q. Which Kafka feature ensures messages are processed in the exact order they are received?

  • (A) Topic-level ordering
  • (B) Partition-level ordering
  • (C) Broker-level ordering
  • (D) Consumer group ordering
πŸ’¬ Discuss
βœ… Correct Answer: (B) Partition-level ordering
Explanation: Kafka guarantees message ordering only within a single partition.

Q. Kafka achieves fault tolerance by:

  • (A) Storing data in XML format
  • (B) Using multiple brokers
  • (C) Compressing all messages
  • (D) Caching all logs
πŸ’¬ Discuss
βœ… Correct Answer: (B) Using multiple brokers
Explanation: Kafka ensures fault tolerance by replicating partitions across multiple brokers.

Q. In Kafka, what is the purpose of the 'key' in a message?

  • (A) Encrypts the message
  • (B) Determines the partition
  • (C) Assigns a consumer
  • (D) Stores the timestamp
πŸ’¬ Discuss
βœ… Correct Answer: (B) Determines the partition
Explanation: The message key is used by Kafka to determine which partition a message goes to.