Interview questions
Apache Kafka Interview Questions
18 Kafka interview questions on partitions, consumer groups, replication, delivery guarantees and KRaft, with model answers for both sides of the table.

What's here
18 Apache Kafka interview questions, grouped into 4 areas: core concepts, reliability and delivery guarantees, operations and design and scenarios. Each one comes with why it is worth asking and what a strong answer contains, so the same question can be scored the same way by different interviewers.
- Start with partitions and ordering; weak answers here predict trouble in every design question
- Use one end-to-end design scenario rather than many definition questions
- Probe delivery semantics with 'what happens if the consumer crashes here?'
Cohesyve finds, contacts and tests Apache Kafka candidates on the real work, then ranks them for these interviews. 14-day free trial for 10 candidates, not charged until it ends.
Preparing for this interview yourself? Practise it free →Kafka interview questions come up for data engineers, backend developers, platform engineers and SREs who build event-driven systems. Apache Kafka is a distributed event streaming platform: producers write events to topics, topics are split into partitions spread across brokers, and consumers read them independently. Interviewers want to see that a candidate understands partitioning, ordering, replication and delivery guarantees well enough to design and run a reliable pipeline. Candidates can use the 'what to look for' notes as model answers; interviewers can use them as a scoring guide.
Core Concepts
The building blocks every Kafka interview starts with.
- 1
Explain topics, partitions, offsets and brokers.
Why ask it
The vocabulary needed for every other question.What to look for
A topic is a named stream of events. It is split into partitions spread across brokers (servers), which allows parallel reads and writes. Each event in a partition has a sequential offset. Events stay available after being read, for the retention period, so many consumers can read the same data. - 2
What ordering guarantees does Kafka give?
Why ask it
Ordering mistakes cause subtle data bugs.What to look for
Order is guaranteed within a partition, not across a whole topic. Events with the same key go to the same partition, so choosing a key (customer ID, order ID) keeps related events in order. Strong candidates mention that adding partitions later changes which partition a key maps to. - 3
How do consumer groups work?
Why ask it
Consumer groups are how Kafka scales consumption.What to look for
Consumers sharing a group ID split the topic's partitions between them, and each partition is read by one consumer in the group at a time. Different groups each get the full stream. More consumers than partitions leaves some idle, so partition count caps parallelism within a group. Rebalancing reassigns partitions when consumers join or leave. - 4
How do you choose the number of partitions for a topic?
Why ask it
A design decision that is awkward to change later.What to look for
Based on the throughput needed and the parallelism of consumers, with headroom for growth, balanced against overhead per partition on brokers. Because key-to-partition mapping changes when partitions are added, plan ahead for keyed topics. - 5
What is the role of KRaft, and what happened to ZooKeeper?
Why ask it
Checks whether the candidate's knowledge is current.What to look for
KRaft is Kafka's built-in consensus mechanism for managing cluster metadata, replacing ZooKeeper. Kafka 4.0, released in March 2025, is the first major release to run entirely without ZooKeeper. Candidates with older experience should know that migrations from ZooKeeper-based clusters move to KRaft.
Before the Apache Kafka interviews, see who can do the work
Cohesyve finds and contacts Apache Kafka candidates from your job description and tests each one on an AI job simulation of the role, so these questions go to a ranked shortlist. 14-day free trial for 10 candidates, not charged until it ends.
Reliability and Delivery Guarantees
How data is kept safe and how often it is delivered.
- 6
How does replication work in Kafka?
Why ask it
Replication is the basis of Kafka's durability.What to look for
Each partition has a leader and follower replicas on other brokers, set by the replication factor. Followers that are caught up form the in-sync replica set (ISR). If the leader fails, a new leader is elected from the in-sync replicas. - 7
What do acks=all and min.insync.replicas do together?
Why ask it
The core durability setting in production.What to look for
With acks=all (the producer default in current versions), the leader waits for the full set of in-sync replicas to acknowledge a write. min.insync.replicas sets the minimum number of replicas that must acknowledge; if fewer are in sync, the producer gets an error instead of silently writing to too few copies. A common setup is a replication factor higher than min.insync.replicas so one broker can fail without blocking writes. - 8
Explain at-most-once, at-least-once and exactly-once delivery.
Why ask it
Delivery semantics drive application design.What to look for
At-most-once: commit offsets before processing, so failures can lose messages. At-least-once: process then commit, so failures can cause duplicates; consumers should be idempotent. Exactly-once: Kafka supports it within Kafka through idempotent producers and transactions (read-process-write across topics); end-to-end exactly-once with external systems also needs idempotent or transactional sinks. - 9
What is an idempotent producer?
Why ask it
Prevents duplicates from producer retries.What to look for
The broker detects and discards duplicate writes caused by retries, so each message is written once per partition. In current Kafka versions idempotence is enabled by default unless conflicting settings are made; it requires acks=all.
Operations and Design
Running Kafka in production and designing around it.
- 10
What is consumer lag, and how would you deal with it growing?
Why ask it
Lag is the main health signal for consumers.What to look for
Lag is the gap between the latest offset in a partition and the consumer's committed offset. Causes: slow processing, too few consumers or partitions, rebalancing storms, or downstream slowness. Fixes: optimise processing, scale consumers up to the partition count, add partitions with care, batch work, and alert on lag trends. - 11
What is log compaction, and when would you use it?
Why ask it
Tests knowledge beyond time-based retention.What to look for
With cleanup.policy=compact, Kafka keeps the latest value for each key and removes older ones, instead of deleting by age. Useful for changelog and state topics, such as the latest profile per user, where consumers need the current state. A null value (tombstone) deletes a key. - 12
What causes consumer rebalances, and how do you reduce their impact?
Why ask it
Frequent rebalances can stall consumption.What to look for
Consumers joining, leaving, crashing or exceeding poll or session timeouts. Mitigations: keep processing within the poll interval, tune timeouts, use static membership or cooperative rebalancing. The newer consumer rebalance protocol (KIP-848) became generally available in Kafka 4.0, with consumers opting in. - 13
How would you handle a message that keeps failing processing?
Why ask it
Poison messages can block a partition.What to look for
Retry with limits and backoff, then send the message to a dead-letter topic with error details so the partition keeps moving; alert and reprocess later. Avoid infinite retries that halt the consumer. - 14
How do you handle schema changes for messages in a topic?
Why ask it
Schema drift breaks consumers.What to look for
Use a serialisation format with schemas (Avro, Protobuf or JSON Schema) and a schema registry, with compatibility rules (backward, forward) so producers and consumers can evolve independently. Add optional fields rather than renaming or removing them.
Scenarios
Short design questions that show applied understanding.
- 15
Design an order-processing pipeline with Kafka where events for each order must stay in order.
Why ask it
Combines keys, partitions and consumers in one design.What to look for
Key events by order ID so each order's events land in one partition; size partitions for throughput; consumer groups per downstream service; idempotent processing; dead-letter handling; monitoring of lag. Good candidates discuss what happens on retries and rebalances. - 16
When would you not use Kafka?
Why ask it
Tests balanced judgement.What to look for
Simple request-response, low volumes where a database table or simple queue is enough, or teams without capacity to operate a cluster. A good answer weighs managed services and simpler queues against Kafka's replay, retention and throughput strengths. - 17
A broker goes down. What happens to producers and consumers?
Why ask it
Checks understanding of failover.What to look for
Partitions led by that broker elect new leaders from in-sync replicas; clients refresh metadata and continue. With acks=all and enough in-sync replicas, no acknowledged data is lost. If in-sync replicas fall below min.insync.replicas, writes to affected partitions fail until replicas recover. - 18
How would you replay events from last Tuesday for one consumer group?
Why ask it
Replay is a key Kafka strength.What to look for
Stop the consumers, reset the group's offsets to a timestamp with the consumer group tooling, and restart, as long as retention still holds that data. Processing must be safe to repeat.
Running the interview well
- 1Start with partitions and ordering; weak answers here predict trouble in every design question
- 2Use one end-to-end design scenario rather than many definition questions
- 3Probe delivery semantics with 'what happens if the consumer crashes here?'
- 4Check whether the candidate's knowledge reflects KRaft-based clusters or older ZooKeeper setups
- 5Ask about an incident they handled, such as lag spikes or rebalancing storms
- 6Separate Kafka user questions from Kafka operator questions to match the role
Common questions
What are the most common Kafka interview questions?
Topics, partitions and offsets, ordering guarantees, consumer groups and rebalancing, replication and in-sync replicas, acks and min.insync.replicas, delivery semantics, idempotent producers, log compaction, consumer lag and KRaft versus ZooKeeper.
Is Kafka a message queue?
Kafka is a distributed event streaming platform. It can be used like a queue, but events are stored durably and can be read by many consumer groups and replayed, which differs from a traditional queue that removes messages once consumed. Kafka 4.0 also introduced Queues for Kafka in early access.
Does Kafka still need ZooKeeper?
No. Kafka 4.0 runs entirely without ZooKeeper, using KRaft for metadata management. Older clusters may still use ZooKeeper until they migrate.
How should I prepare for a Kafka interview?
Run a local cluster, produce and consume with keys, watch partition assignment change as you add consumers, and test what happens when a broker stops. Be ready to design a small pipeline and explain your choices on keys, partitions and delivery guarantees.
Do data engineers and backend developers get the same Kafka questions?
The core concepts are the same. Data engineers get more on pipelines, Kafka Connect, schemas and stream processing; backend developers get more on producer and consumer code, idempotency and error handling.
What is the difference between Kafka and Kafka Streams?
Kafka is the event streaming platform. Kafka Streams is a client library for building stream-processing applications that read from and write to Kafka topics.
Save these questions for the Apache Kafka candidates who can do the work
Cohesyve takes your Apache Kafka job description, finds candidates, reaches out to them and runs an AI job simulation of the real work, then returns a ranked shortlist.
1,500+
assessments completed
50%
faster time-to-hire
5 min
from JD to assessment
14-day free trial · 10 candidates · Not charged until the trial ends
Preparing for an Apache Kafka interview yourself? Practise on an AI job simulation of the role. 3-day free trial, cancel anytime.
From the blog