Learn. Practice. Feel prepared.
Apache Kafka Objective Questions and Answers
This Apache Kafka quiz contains carefully curated objective questions with correct answers and clear explanations. It is designed for developers, data engineers, and interview preparation, covering Kafka internals, distributed messaging concepts, fault tolerance, and real-time streaming best practices.
Practice Apache Kafka MCQs with Detailed Explanations
Answer at least 12 questions to submit and verify answers.
1 What is the primary role of Apache Kafka in distributed systems? Easy
Correct answer:
Message streaming platform
Apache Kafka is a distributed event streaming platform used for building real-time data pipelines and streaming applications.
2 What is a Kafka topic? Easy
Correct answer:
A stream of records
A topic in Kafka is a category or feed name to which records are published.
3 Which component is responsible for storing Kafka data? Medium
Correct answer:
Broker
Kafka brokers are servers that store data and serve client requests.
4 What is the purpose of partitions in Kafka? Medium
Correct answer:
Parallelism and scalability
Partitions allow Kafka to scale horizontally and process data in parallel.
5 What ensures fault tolerance in Kafka? Medium
Correct answer:
Replication
Kafka replicates partitions across brokers to ensure data availability and fault tolerance.
6 What is an offset in Kafka? Medium
Correct answer:
Record index in a partition
Offset is a unique identifier for each record within a partition.
7 Which API is used to publish messages to Kafka? Easy
Correct answer:
Producer API
Producer API is used to send records to Kafka topics.
8 What does ISR stand for in Kafka? Medium
Correct answer:
In Sync Replicas
ISR (In Sync Replicas) are replicas that are fully caught up with the leader.
9 What happens if a leader broker fails? Medium
Correct answer:
New leader is elected from ISR
Kafka elects a new leader from the in-sync replicas to ensure availability.
10 Which guarantee ensures messages are not lost but may be duplicated? Medium
Correct answer:
At-least-once
At-least-once guarantees delivery but may result in duplicates.
11 What is idempotent producer in Kafka? High
Correct answer:
Prevents duplicates
Idempotent producer ensures messages are written exactly once, preventing duplicates.
12 Which property enables exactly-once semantics? High
Correct answer:
enable.idempotence=true
enable.idempotence=true ensures no duplicate messages from the producer.
13 What is a consumer group? Medium
Correct answer:
Group of consumers sharing load
Consumer groups allow parallel consumption of partitions.
14 If a topic has 3 partitions and a consumer group has 5 consumers, how many consumers will be idle? High
Correct answer:
2
Only 3 consumers can read from 3 partitions, so 2 will remain idle.
15 Which Kafka component was traditionally used for cluster coordination? Medium
Correct answer:
Zookeeper
Zookeeper was used for managing cluster metadata and leader election.