Q. Kafka message ordering is guaranteed:

  • (A) Across all partitions
  • (B) Per topic
  • (C) Within a single partition
  • (D) Only for compacted topics
πŸ’¬ Discuss
βœ… Correct Answer: (C) Within a single partition
Explanation: Kafka only guarantees ordering within individual partitions.

Q. Kafka uses which mechanism to avoid message duplication?

  • (A) ZooKeeper checks
  • (B) Checksum hashing
  • (C) Idempotent producer
  • (D) Consumer replay
πŸ’¬ Discuss
βœ… Correct Answer: (C) Idempotent producer
Explanation: Kafka's idempotent producer ensures that retrying sends does not duplicate messages.

Q. What is the purpose of Kafka Connect?

  • (A) Build UI for Kafka
  • (B) Connect external systems with Kafka
  • (C) Monitor brokers
  • (D) Manage consumer groups
πŸ’¬ Discuss
βœ… Correct Answer: (B) Connect external systems with Kafka
Explanation: Kafka Connect simplifies integration between Kafka and external systems such as databases.

Q. Kafka compaction is used to:

  • (A) Compress message size
  • (B) Remove duplicate keys and retain the latest record
  • (C) Distribute partitions evenly
  • (D) Backup all data
πŸ’¬ Discuss
βœ… Correct Answer: (B) Remove duplicate keys and retain the latest record
Explanation: Log compaction ensures the latest value for each key is retained in the topic.

Q. What type of messages does Kafka Streams work with?

  • (A) Encrypted messages
  • (B) Binary messages only
  • (C) Key-value pairs
  • (D) Image files
πŸ’¬ Discuss
βœ… Correct Answer: (C) Key-value pairs
Explanation: Kafka Streams processes key-value pairs from topics.

Q. Kafka topics with compaction enabled are useful for:

  • (A) Event logs
  • (B) User profile updates
  • (C) Audio streaming
  • (D) Data compression
πŸ’¬ Discuss
βœ… Correct Answer: (B) User profile updates
Explanation: Compacted topics retain only the most recent update for each key, ideal for things like profile updates.

Q. In a Kafka cluster, which node acts as the leader of a partition?

  • (A) Producer
  • (B) Consumer
  • (C) Controller
  • (D) Broker hosting the partition's leader replica
πŸ’¬ Discuss
βœ… Correct Answer: (D) Broker hosting the partition's leader replica
Explanation: Each partition has a leader replica managed by one of the brokers.

Q. What is the default data retention policy in Kafka?

  • (A) Based on consumer offset
  • (B) Based on file size only
  • (C) Time-based retention
  • (D) Key-based retention
πŸ’¬ Discuss
βœ… Correct Answer: (C) Time-based retention
Explanation: Kafka retains data based on a configured time limit, regardless of consumer status.

Q. What ensures Kafka producers don’t overwhelm the broker?

  • (A) Consumer quotas
  • (B) Backpressure
  • (C) ZooKeeper throttling
  • (D) Producer replication
πŸ’¬ Discuss
βœ… Correct Answer: (B) Backpressure
Explanation: Backpressure prevents producers from sending data too quickly for brokers to handle.

Q. Which Kafka feature helps prevent loss of unprocessed messages?

  • (A) Offset tracking
  • (B) Message TTL
  • (C) Producer replication
  • (D) Stream shutdown hooks
πŸ’¬ Discuss
βœ… Correct Answer: (A) Offset tracking
Explanation: Kafka uses consumer offset tracking to ensure reliable delivery.