Kafka MCQs – Introduction to Apache Kafka

21.) Kafka guarantees message order in which of the following?

A) Across the topic
B) Within a consumer group
C) Across partitions
D) Within a partition

Answer: Option D

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

22.) Kafka provides data durability through:

A) Cloud sync
B) Disk writes and replication
C) Memory cache
D) Zookeeper

Answer: Option B

Explanation: Kafka writes data to disk and replicates it across brokers for durability.

23.) What is the default serialization format used in Kafka Java clients?

A) XML
B) String
C) Avro
D) JSON

Answer: Option B

Explanation: The default serializer is the StringSerializer.

24.) Which of the following statements is true about Kafka?

A) Kafka only supports one producer per topic
B) Kafka does not support data retention
C) Kafka can only run on Windows
D) Kafka is fault-tolerant and scalable

Answer: Option D

Explanation: Kafka is built for scalability and reliability in distributed systems.

25.) Kafka messages are persisted:

A) In memory
B) In log files on disk
C) In Zookeeper
D) In a database

Answer: Option D

Explanation: Kafka persists all messages to log files on the disk.

26.) In Kafka, a Partition is:

A) A way to divide a topic into smaller parts
B) A consumer group
C) A protocol
D) An access token

Answer: Option A

Explanation: Partitions allow Kafka topics to be horizontally scaled.

27.) What is a Consumer Group in Kafka?

A) A set of producers
B) A set of consumers that work independently
C) A set of consumers sharing the same group id to coordinate consumption
D) A set of Zookeeper nodes

Answer: Option C

Explanation: Consumer groups allow Kafka to scale horizontally by assigning partitions among consumers.

28.) Kafka is written in which programming language?

A) Python
B) Java and Scala
C) Go
D) JavaScript

Answer: Option B

Explanation: Kafka is primarily developed using Java and Scala.

29.) Kafka follows which messaging guarantee?

A) At-most-once
B) At-least-once
C) Exactly-once (with config)
D) All of the above

Answer: Option D

Explanation: Kafka supports all three delivery guarantees depending on the configuration.

30.) Kafka can be best described as:

A) A NoSQL database
B) A stream processing engine
C) A file-based batch system
D) A distributed messaging system

Answer: Option D

Explanation: Kafka is a highly scalable, distributed publish-subscribe messaging system.

Leave a Reply

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