Learn. Practice. Feel prepared.
Apache Kafka Objective Questions and Answers - Set 2
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. This is part 2 of the series.
Practice Apache Kafka MCQs with Detailed Explanations
Answer at least 12 questions to submit and verify answers.
16 What is KRaft mode in Kafka? High
Correct answer:
Zookeeper replacement
KRaft removes the dependency on Zookeeper by integrating metadata management into Kafka.
17 Which configuration controls message durability? Medium
Correct answer:
acks
acks determines how many acknowledgments are required for a write to be considered successful.
18 What does acks=all mean? High
Correct answer:
All replicas acknowledge
acks=all ensures all in-sync replicas confirm the write for maximum durability.
19 Which API is used for stream processing in Kafka? Medium
Correct answer:
Streams API
Kafka Streams API is used to build real-time streaming applications.
20 What is Kafka Connect used for? Medium
Correct answer:
Data integration
Kafka Connect is used to integrate Kafka with external systems like databases.
21 Which partitioner decides message distribution? High
Correct answer:
Producer
Producer uses a partitioner to decide which partition a message should go to.
22 What is log compaction? High
Correct answer:
Keeping latest record per key
Log compaction retains only the latest value for each key.
23 Which retention policy deletes messages after time? Medium
Correct answer:
retention.ms
retention.ms defines how long messages are retained.
24 What happens when retention.ms expires? Medium
Correct answer:
Messages deleted
Messages older than retention.ms are deleted.
25 What is the default partitioner behavior without a key? High
Correct answer:
Round-robin
Kafka uses round-robin distribution when no key is provided.
26 Which metric indicates consumer lag? Medium
Correct answer:
Offset difference
Consumer lag is the difference between latest offset and consumed offset.
27 What is a rebalance in Kafka? High
Correct answer:
Consumer group re-distribution
Rebalance redistributes partitions among consumers.
28 What causes frequent rebalances? High
Correct answer:
Consumer joins/leaves
Frequent joins/leaves trigger rebalances.
29 Which serializer converts objects to bytes? Medium
Correct answer:
Serializer
Serializer converts data into byte format for Kafka transmission.
30 What is the role of deserializer? Medium
Correct answer:
Convert bytes to objects
Deserializer converts byte data back into usable objects.