Huru
Technical Interviews

Kafka Interview Questions and Answers (2026)

Apache Kafka interview questions with short answers: events, topics and partitions, ordering, consumer groups and offsets, replication and in-sync replicas, delivery semantics, producer settings, retention and compaction, performance tuning, and scenario questions for experienced engineers.

By Amine Boukioud Updated 4 min read
The Huru mascot pointing at three transparent tubes carrying ordered colored cubes from producer machines on the left to collection baskets on the right

The short answer: Kafka interviews test whether you understand how data is organized (topics, partitions, keys), how it’s consumed (consumer groups, offsets, rebalancing), how it’s kept safe (replication, acknowledgments, in-sync replicas), delivery guarantees (at-most-once, at-least-once, exactly-once), and how to operate and tune it. Experienced roles add scenario questions such as consumer lag, ordering problems or a broker failure. Below are the common questions with short answers, grouped by area.

Core concepts

“What is Kafka, and what is event streaming?”

Apache Kafka is a distributed event streaming platform. The Kafka documentation describes event streaming as “capturing data in real-time from event sources like databases, sensors, mobile devices, cloud services, and software applications in the form of streams of events.”

“What is an event?”

In Kafka’s words, an event “records the fact that ‘something happened’.” It has a key, a value, a timestamp and optional headers.

“What are producers, consumers and topics?”

Producers write events; consumers read them. “Events are organized and durably stored in topics,” similar to a folder of files.

“What is a partition?”

A topic is split into partitions spread across brokers, so it can scale. Events with the same key go to the same partition.

Ordering

“Does Kafka guarantee ordering?”

Only within a partition. Kafka “guarantees that any consumer of a given topic-partition will always read that partition’s events in exactly the same order as they were written.” There’s no ordering across partitions, so use a key (such as a customer ID) for events that must stay in order.

Consumers

“What is a consumer group?”

Consumers that share a group ID divide a topic’s partitions between them, so each partition is read by only one consumer in the group. Different groups each get all the messages.

“What happens if you have more consumers than partitions?”

The extra consumers sit idle. The number of partitions limits parallelism within a group.

“What is an offset?”

The position of a message in a partition. Consumers commit offsets to record what they’ve processed, so they can resume after a restart.

“What is a rebalance?”

Redistributing partitions among a group’s consumers when one joins, leaves or fails. Rebalances pause consumption briefly, so frequent ones hurt throughput.

“What is consumer lag, and how do you reduce it?”

How far a consumer is behind the latest messages. Reduce it by adding consumers (up to the partition count), adding partitions, speeding up processing, or batching.

Replication and durability

“How does replication work?”

Each partition has a leader and follower replicas on other brokers. The documentation notes that topics can be replicated “so that there are always multiple brokers that have a copy of the data.” A replication factor of 3 is common in production.

“What are in-sync replicas (ISR)?”

Replicas that are caught up with the leader. With acks=all, the producer waits until all in-sync replicas have the write; combined with min.insync.replicas, this protects against data loss.

Delivery semantics

“Explain at-most-once, at-least-once and exactly-once.”

  • At-most-once: messages may be lost but never duplicated (commit offsets before processing).
  • At-least-once: no loss, but possible duplicates (commit after processing); make consumers idempotent.
  • Exactly-once: achieved with idempotent producers and transactions for read-process-write flows within Kafka.

“What does an idempotent producer do?”

It prevents duplicate writes caused by retries, so each message is written once per partition.

Storage

“What’s the difference between retention and log compaction?”

Retention deletes old data by time or size. Log compaction keeps at least the latest value for each key, which suits topics that represent current state.

Performance

“How do you improve producer throughput?”

Batch more (batch.size, linger.ms), compress messages, and use asynchronous sends, while balancing latency.

“How do you choose the number of partitions?”

Based on target throughput and consumer parallelism, with room to grow. Too many partitions increase overhead and recovery time.

Scenario questions

  • “Consumer lag keeps growing. What do you check?” Processing time per message, consumer errors and rebalances, partition skew, and whether you have enough consumers.
  • “Some events are processed out of order. Why?” They probably landed in different partitions; key them by the entity that needs ordering.
  • “A broker goes down. What happens?” Leadership for its partitions moves to in-sync replicas on other brokers; check under-replicated partitions and producer settings.
  • “You see duplicate messages downstream.” Check producer retries and idempotence, offset commit timing, and make consumers idempotent.

Behavioral questions

  • Tell me about a streaming pipeline you built or maintained.
  • Tell me about an incident with Kafka and how you resolved it. See solving a complex problem.

See also our data engineer interview questions and system design interview guide.

Frequently asked questions

What are common Kafka interview questions?
Questions on topics, partitions and keys, ordering, consumer groups, offsets and rebalancing, consumer lag, replication and in-sync replicas, acks, delivery semantics, idempotent producers, retention and compaction, performance tuning, and scenarios such as lag, out-of-order events or broker failure.
Does Kafka guarantee message ordering?
Only within a partition. Consumers read a partition's events in the order they were written. Use a key so related events go to the same partition.
What is a consumer group in Kafka?
A set of consumers sharing a group ID that divide a topic's partitions between them, so each partition is read by one consumer in the group.
How does Kafka achieve exactly-once processing?
With idempotent producers and transactions for read-process-write flows within Kafka. Outside Kafka, consumers usually need to be idempotent.
What is log compaction?
A retention mode that keeps at least the latest value for each key instead of deleting data by time or size, which suits topics representing current state.

Sources

Practice this with Huru AI

Turn what you just read into a rehearsal. Unlimited AI mock interviews with instant, specific feedback.

Amine Boukioud

Amine Boukioud is a co-founder of Beatview, Inc., the company behind Huru, and Head of Growth at Huru. He writes and reviews Huru’s interview guides; each one starts from primary sources such as employers’ own careers pages, official data and research, and follows Huru’s editorial policy.

Published · Updated

How this article was made: researched and drafted with AI assistance, then written, fact-checked and signed by Amine Boukioud on October 1, 2026. Sources are linked where they are used. How we work: editorial policy.