Q. In a Kafka cluster, each broker has a unique:

  • (A) IP address
  • (B) Cluster name
  • (C) broker.id
  • (D) Topic name
πŸ’¬ Discuss
βœ… Correct Answer: (C) broker.id
Explanation: Each Kafka broker is identified by a unique 'broker.id'.

Q. Kafka clients can be written in:

  • (A) Java only
  • (B) C++ only
  • (C) Multiple languages
  • (D) Python only
πŸ’¬ Discuss
βœ… Correct Answer: (C) Multiple languages
Explanation: Kafka clients exist for many languages like Java, Python, C++, Go, etc.

Q. Kafka is designed to handle:

  • (A) Small datasets only
  • (B) Large-scale data streams
  • (C) Mobile UI rendering
  • (D) Simple command-line applications
πŸ’¬ Discuss
βœ… Correct Answer: (B) Large-scale data streams
Explanation: Kafka is optimized for high-throughput, large-scale real-time data streams.

Q. What happens if a Kafka producer sends messages faster than the broker can handle?

  • (A) Messages are lost
  • (B) Producer blocks or errors depending on configuration
  • (C) Broker stops automatically
  • (D) ZooKeeper reassigns partitions
πŸ’¬ Discuss
βœ… Correct Answer: (B) Producer blocks or errors depending on configuration
Explanation: If buffer memory is full, the producer will block or throw an exception based on configuration.

Q. Kafka topics are split into partitions to:

  • (A) Store data permanently
  • (B) Enable concurrent reads and writes
  • (C) Reduce message size
  • (D) Encrypt messages
πŸ’¬ Discuss
βœ… Correct Answer: (B) Enable concurrent reads and writes
Explanation: Partitions allow parallelism for producers and consumers.

Q. Which Kafka component acts as a distributed commit log?

  • (A) Consumer
  • (B) Producer
  • (C) Topic
  • (D) Broker
πŸ’¬ Discuss
βœ… Correct Answer: (D) Broker
Explanation: Kafka brokers maintain logs of all messages in a partition, like a distributed commit log.

Q. Kafka is optimized for:

  • (A) Low latency messaging
  • (B) Batch processing
  • (C) Short-lived tasks
  • (D) Browser caching
πŸ’¬ Discuss
βœ… Correct Answer: (A) Low latency messaging
Explanation: Kafka provides low-latency message processing with high throughput.

Q. Kafka consumers subscribe to topics using:

  • (A) ZooKeeper
  • (B) Consumer groups
  • (C) Kafka admin
  • (D) Broker IDs
πŸ’¬ Discuss
βœ… Correct Answer: (B) Consumer groups
Explanation: Consumers belong to a group and subscribe to topics for coordinated message consumption.

Q. Which of these improves Kafka message durability?

  • (A) acks=0
  • (B) acks=all
  • (C) acks=1
  • (D) acks=auto
πŸ’¬ Discuss
βœ… Correct Answer: (B) acks=all
Explanation: With acks=all, the producer waits for all in-sync replicas to acknowledge the message.

Q. Kafka’s retention policy is based on:

  • (A) Number of messages
  • (B) Consumer lag
  • (C) Time or size
  • (D) Broker load
πŸ’¬ Discuss
βœ… Correct Answer: (C) Time or size
Explanation: Kafka retains messages based on time (log.retention.ms) or size (log.retention.bytes).