Q. Kafka's replication factor determines:

  • (A) Number of messages sent
  • (B) Number of brokers used to store a partition copy
  • (C) Consumer group size
  • (D) Producer throughput
πŸ’¬ Discuss
βœ… Correct Answer: (B) Number of brokers used to store a partition copy
Explanation: Replication factor defines how many broker copies are kept for each partition.

Q. What is the primary function of Kafka brokers?

  • (A) Coordinate consumers
  • (B) Manage cluster metadata
  • (C) Receive, store, and serve messages
  • (D) Encrypt data streams
πŸ’¬ Discuss
βœ… Correct Answer: (C) Receive, store, and serve messages
Explanation: Kafka brokers handle message storage, delivery, and partition management.

Q. Kafka consumers fetch data from:

  • (A) ZooKeeper
  • (B) Kafka topics
  • (C) Producers
  • (D) Kafka controller
πŸ’¬ Discuss
βœ… Correct Answer: (B) Kafka topics
Explanation: Consumers subscribe to topics and fetch data directly from partitions.

Q. Kafka partitions help achieve:

  • (A) Message encryption
  • (B) Low availability
  • (C) High throughput and parallelism
  • (D) Topic deletion
πŸ’¬ Discuss
βœ… Correct Answer: (C) High throughput and parallelism
Explanation: Partitioning allows parallel processing and improves throughput.

Q. What is the purpose of Kafka’s retention policy?

  • (A) To remove duplicates
  • (B) To compress messages
  • (C) To control how long messages are stored
  • (D) To trigger consumer actions
πŸ’¬ Discuss
βœ… Correct Answer: (C) To control how long messages are stored
Explanation: Retention policy defines how long Kafka retains messages in a topic.

Q. What type of messaging system is Kafka?

  • (A) Pull-based
  • (B) Push-based
  • (C) Hybrid
  • (D) Time-triggered
πŸ’¬ Discuss
βœ… Correct Answer: (A) Pull-based
Explanation: Kafka uses a pull model where consumers request messages from brokers.

Q. Kafka message offsets are unique to:

  • (A) The whole topic
  • (B) The broker
  • (C) Each partition
  • (D) The producer
πŸ’¬ Discuss
βœ… Correct Answer: (C) Each partition
Explanation: Offsets are unique within a partition and track message position.

Q. In Kafka, what is a 'leader' replica?

  • (A) The replica that is offline
  • (B) The one that handles all reads and writes
  • (C) The last message sent
  • (D) The oldest broker
πŸ’¬ Discuss
βœ… Correct Answer: (B) The one that handles all reads and writes
Explanation: Only the leader replica serves client requests for a partition.

Q. Kafka’s log compaction is useful for:

  • (A) Deleting old messages
  • (B) Storing only latest updates per key
  • (C) Batch compression
  • (D) Offset reset
πŸ’¬ Discuss
βœ… Correct Answer: (B) Storing only latest updates per key
Explanation: Log compaction ensures only the latest value per key is retained.

Q. Which component is used to stream data processing in Kafka?

  • (A) Kafka MirrorMaker
  • (B) Kafka Streams API
  • (C) Kafka Broker
  • (D) Kafka Offset Manager
πŸ’¬ Discuss
βœ… Correct Answer: (B) Kafka Streams API
Explanation: Kafka Streams API is used to process data in real-time directly from Kafka topics.