Kafka MCQs – Kafka Architecture and Core Concepts

11.) Which broker acts as the controller in Kafka?

A) Any broker chosen by Zookeeper
B) The oldest broker
C) Broker with highest ID
D) Always broker 0

Answer: Option A

Explanation: Zookeeper designates one broker as the controller to manage partition leadership and cluster metadata.

12.) Which element does a consumer group subscribe to?

A) Individual messages
B) Partitions
C) Producers
D) Topics

Answer: Option D

Explanation: Consumers subscribe to topics, and partitions of that topic are distributed among group members.

13.) Kafka ensures message ordering:

A) Across all topics
B) Within each consumer
C) Across all brokers
D) Within a partition

Answer: Option D

Explanation: Kafka guarantees message ordering only within a single partition.

14.) What is log compaction used for?

A) Encrypting messages
B) Removing duplicate or old records by key
C) Partition balancing
D) Schema validation

Answer: Option B

Explanation: Log compaction retains only the latest value for each key, optimizing storage.

15.) What is the maximum number of partitions a topic can have?

A) 1
B) 10
C) Unlimited
D) 100

Answer: Option C

Explanation: Kafka allows as many partitions as the system can handle, enabling scalability.

16.) What is the default number of partitions for a new topic (if not specified)?

A) 1
B) 3
C) 2
D) 0

Answer: Option A

Explanation: By default, Kafka creates a topic with one partition if not configured otherwise.

17.) What is the primary benefit of having more partitions in a topic?

A) Increased durability
B) Improved ordering
C) Better parallelism and throughput
D) Better message encryption

Answer: Option C

Explanation: More partitions enable better load distribution and parallel consumption.

18.) A Kafka topic with 6 partitions can be consumed by how many consumers in a group in parallel?

A) 1
B) 3
C) 6
D) Unlimited

Answer: Option C

Explanation: A consumer group can have up to as many consumers as there are partitions to consume in parallel.

19.) Kafka uses what for high performance disk writes?

A) XML storage
B) Write-ahead logging
C) Memory cache only
D) SSD-level compression

Answer: Option B

Explanation: Kafka uses an append-only log format that enables fast disk I/O.

20.) Which component in Kafka tracks and manages offsets?

A) Consumer
B) Kafka Connect
C) Zookeeper
D) Schema Registry

Answer: Option A

Explanation: Consumers are responsible for managing and committing offsets.

Leave a Reply

Your email address will not be published. Required fields are marked *