Kafka Interview Questions: 16 Answers on Offsets, ISR and KRaft (2026)

16 Kafka interview questions with sample answers: partitions and ordering, acks and min.insync.replicas, exactly-once, rebalances, KRaft and share groups.

By OphyAI Team • • Updated November 24, 2026 • 3973 words

Last updated: November 2026

Quick Answer

Kafka interviewers test whether you can reason about the guarantees, not recite the API: how partitions and keys give ordering, how offsets and consumer groups track progress, what acks=all and min.insync.replicas actually protect, how idempotent producers and transactions give exactly-once inside Kafka, and how KRaft replaced ZooKeeper in Kafka 4.0. Expect concept questions, a debugging scenario (lag, duplicates, rebalances) and a pipeline design. Rehearse the answers aloud in OphyAI Interview Practice, and prepare live coding and design rounds with OphyAI Coding Interview.

#QuestionWhat it tests
1Topics, partitions and brokersCore model
2How ordering worksKeys and partitions
4Offsets and consumer groupsProgress tracking
6Delivery semanticsPrecise vocabulary
7acks and min.insync.replicasDurability trade-offs
8ISR and unclean leader electionReplication
9Exactly-once with transactionsLimits of the guarantee
11Rebalances and the new protocolOperations
12Consumer lagDebugging
15KRaft vs ZooKeeperPlatform awareness

The numbers match the full list below, which runs in the order interviews usually go: the data model, consumers, durability, processing guarantees, operations and the platform. Every technical claim here comes from the Apache Kafka 4.4 documentation, the release announcements or Confluent’s documentation (see Sources).

The Questions, With Sample Answers

1. “What are topics, partitions and brokers in Kafka?”

Why they ask. Every later answer (ordering, scaling, replication) depends on the model, and a fuzzy start shows quickly.

Sample answer. “Kafka stores streams of events in topics. A topic is split into partitions, and the Kafka docs describe them as buckets placed on different brokers, the servers in the cluster. That placement is what lets many clients read and write in parallel. Each partition is an ordered, append-only log, and every record in it gets a sequential offset. Kafka does not delete events after they are consumed; retention is a per-topic setting, and by default retention.ms is seven days. Each partition is replicated to several brokers, with one leader handling the writes and followers copying it. So when I size a topic, I think about partitions for parallelism and replicas for durability as two separate decisions.”

Weak answers. Describing Kafka as a queue that deletes messages once read, or treating a partition and a replica as the same thing.

Practice the one-minute version of this model in OphyAI Interview Practice, which asks a follow-up and gives feedback on each answer.

2. “Does Kafka guarantee message ordering?”

Why they ask. It is the most common trap question, because the honest answer is “only within a partition.”

Sample answer. “Kafka guarantees order within a partition, not across a topic. The docs say events with the same key, such as a customer or vehicle ID, are written to the same partition, and any consumer of that partition reads them in exactly the order they were written. So if order matters per entity, I make that entity ID the key. If I need a total order across everything, I’d need a single partition, which caps throughput, so I’d push back on whether the business really needs it. Two more details: the idempotent producer, which is on by default, keeps order with up to five in-flight requests per connection, and adding partitions later changes which partition a key hashes to, which can break per-key order during the change.”

Weak answers. “Yes, Kafka is ordered,” or not mentioning keys at all.

3. “How does the producer choose a partition?”

Why they ask. It checks that you know keys drive placement and what happens without one.

Sample answer. “If the record names a partition, that’s used. If not and there’s a key, the default logic picks a partition from a hash of the key, so the same key keeps landing in the same place. If there’s no key, the default partitioner uses a sticky partition: it keeps sending to one partition until at least batch.size bytes have gone there, then switches. That builds bigger batches than strict round robin. There’s also a rack-aware option when client.rack is set and partitioner.rack.aware is true. The practical risk is a hot key: one very large customer can overload one partition while others sit idle. I’d spot that by per-partition throughput and fix it by salting the key or splitting that tenant’s traffic.”

Weak answers. “Kafka round-robins records,” which has not described the default keyless behavior for years.

Prepare for producer design questions with OphyAI: Interview Practice will ask what happens to a hot key at ten times the traffic.

4. “What is an offset, and how do consumer groups work?”

Why they ask. Offsets are how Kafka tracks progress, and getting commit timing wrong causes most real bugs.

Sample answer. “An offset is a record’s position in a partition. Consumers pull data from brokers rather than having it pushed, and each consumer group keeps its own committed offset per partition, so two groups can read the same topic independently. Within a group, each partition is assigned to one consumer at a time, which is why adding consumers beyond the partition count leaves some idle. The committed position is stored in an internal Kafka topic. By default enable.auto.commit is true, which commits on a timer. For anything where loss or duplication matters, I turn that off and commit after processing, which gives at-least-once delivery, and I make processing idempotent so a replay is harmless.”

Weak answers. Saying the broker deletes records once a consumer acknowledges them, or not knowing where offsets are stored.

5. “What does auto.offset.reset do?”

Why they ask. It shows whether you have debugged a new consumer group that “lost” data.

Sample answer. “It decides where a consumer starts when its group has no committed offset, or when the committed offset no longer exists because the data aged out. The default is latest, which starts at the end of the log, so a brand-new group skips everything already there. earliest starts at the oldest retained record, and none throws an exception instead of guessing. Newer versions also accept by_duration with an ISO 8601 duration, which starts from a point in time. The Kafka docs warn that latest can silently skip records when partitions are added, because producers can write to a new partition before the consumer discovers it, and they suggest by_duration for that case. For a new pipeline, I set this explicitly rather than trusting the default.”

Weak answers. “It resets the offset to zero,” or thinking it applies to every restart, not just groups without a valid committed offset.

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

Why they ask. Precise vocabulary here separates people who have run pipelines from people who have read a blog.

Sample answer. “The Kafka docs define them plainly. At most once: messages may be lost but are never redelivered. At least once: messages are never lost but may be redelivered. Exactly once: each message is processed once and only once. On the consumer side, the difference is commit order. If I commit the offset and then process, a crash loses those records, which is at-most-once. If I process and then commit, a crash replays them, which is at-least-once. Most production systems run at-least-once with idempotent writes, for example an upsert keyed on an event ID, because receiving the same message twice then just overwrites a record with itself.”

Weak answers. Treating exactly-once as the default, or describing semantics without saying where the offset commit happens.

Prepare for guarantee questions with OphyAI: run them in Interview Practice until you can draw the commit order without notes.

7. “What do acks and min.insync.replicas control?”

Why they ask. It is the core durability trade-off, and many candidates mix up the producer and topic settings.

Sample answer. “acks is a producer setting for how many acknowledgments the leader needs before a send counts as successful. acks=0 doesn’t wait, acks=1 waits for the leader’s write, and acks=all waits for the full in-sync replica set. acks=all is the default in current Kafka. min.insync.replicas is a topic or broker setting, default 1, and it only matters with acks=all: if fewer replicas than that are in sync, the leader rejects the write instead of accepting it with weak durability. The classic setup is replication factor 3, min.insync.replicas 2 and acks=all. That survives one broker failure without losing committed data, and with two brokers down it chooses unavailability over the risk of loss.”

Weak answers. “acks=all means every replica, including dead ones,” or not knowing min.insync.replicas exists.

8. “What is the ISR, and what is unclean leader election?”

Why they ask. It tests whether you understand Kafka’s replication model rather than assuming a majority vote.

Sample answer. “The ISR is the set of in-sync replicas for a partition: followers that are alive and caught up with the leader. A follower that dies or lags too far behind is removed. A message is committed once all in-sync replicas have it, and Kafka’s guarantee is that a committed message isn’t lost as long as one in-sync replica stays alive. The docs explain why this isn’t a majority quorum: with f+1 replicas Kafka tolerates f failures, where majority voting needs 2f+1 copies. Unclean leader election is the case where every in-sync replica is gone. Enabling it lets an out-of-sync replica become leader, restoring availability but possibly losing data. It is off by default, so the partition stays unavailable instead.”

Weak answers. Describing Kafka replication as Raft-style majority voting for data, or saying unclean election is a performance setting.

Prepare for replication questions with OphyAI: Interview Practice can ask you to walk a broker failure step by step.

9. “How does Kafka achieve exactly-once processing, and what are its limits?”

Why they ask. It is the most over-claimed Kafka feature, so interviewers check where the guarantee ends.

Sample answer. “Two pieces. The idempotent producer, available since 0.11 and enabled by default now, gets a producer ID and sends sequence numbers, so the broker drops duplicates from retries. Transactions let a producer write to several partitions atomically, and the consumer’s offsets can be committed in the same transaction, because offsets live in an internal topic. If the transaction aborts, the output isn’t visible to consumers reading with isolation.level=read_committed, whose default is read_uncommitted. In Kafka Streams I get this with processing.guarantee=exactly_once_v2; the default is at_least_once. The limit: this covers Kafka-to-Kafka pipelines. A write to an external database or an API call is outside the transaction, so the sink still has to be idempotent.”

Weak answers. “Kafka is exactly-once out of the box,” or forgetting that consumers must read committed data.

10. “What is log compaction, and when would you use it?”

Why they ask. It shows you know Kafka can act as a changelog, not just a time-limited buffer.

Sample answer. “Kafka has two cleanup policies: delete, the default, which drops old segments by time or size, and compact. Log compaction guarantees Kafka keeps at least the last known value for each key within a partition. The docs name the use cases: restoring state after an application crash, or reloading a cache after a restart, such as a table of customer profiles keyed by customer ID. Deletes work through tombstones: a record with a key and a null value removes earlier values for that key, and the tombstone itself is cleaned up after a configured delay. One thing to say aloud: compaction isn’t immediate, so a consumer can still see several older values for the same key before the cleaner runs.”

Weak answers. Confusing compaction with compression, or saying it keeps exactly one record per key at all times.

Prepare for storage questions with OphyAI: rehearse the delete versus compact choice in Interview Practice with a real use case.

11. “What causes a consumer group rebalance, and how has the protocol changed?”

Why they ask. Rebalances cause real outages, and Kafka 4.0 changed how they work.

Sample answer. “A rebalance reassigns partitions when membership changes: a consumer joins, leaves, crashes, or exceeds max.poll.interval.ms, which defaults to five minutes, between polls. The classic protocol could stop the whole group while partitions moved. Kafka 4.0 made KIP-848, the next-generation consumer rebalance protocol, generally available. It moves assignment to the broker-side coordinator and is enabled on the server by default since 4.0, but clients opt in with group.protocol=consumer; the client default is still classic. With the new protocol, settings like session.timeout.ms and partition.assignment.strategy are no longer used on the client. To reduce rebalances on restarts, static membership with group.instance.id also helps. If processing is slow, I cut max.poll.records, default 500, rather than just raising the poll interval.”

Weak answers. Not knowing what triggers a rebalance, or claiming 4.0 forces every client onto the new protocol.

12. “Consumer lag is growing. How do you debug it?”

Why they ask. It is the most common Kafka on-call scenario.

Sample answer. “First I measure it per partition with kafka-consumer-groups.sh describe, which shows each consumer’s position and how far behind the log end it is. Then I ask: is lag on every partition or a few? A few points to a hot key or one slow consumer. All of them points to throughput: processing is too slow, or the producer rate jumped. Next I check whether the group is stuck rebalancing, because constant rebalances look like lag. Fixes depend on the cause: add consumers up to the partition count, speed up per-record work or batch external writes, fix a hot key, or add partitions as a last resort, since that changes key placement. I’d also alert on lag growth over time, not one absolute number.”

Weak answers. “Add more consumers,” without checking partition count or whether the group is rebalancing.

Prepare for debugging scenarios with OphyAI: Interview Practice can play the on-call interviewer and keep asking “what do you check next?“

13. “What is the difference between Kafka Streams and Kafka Connect?”

Why they ask. It checks you know the ecosystem and pick the right tool.

Sample answer. “Kafka Connect moves data between Kafka and other systems. The docs describe it as a tool for scalably and reliably streaming data in and out: source connectors pull from databases or apps, sink connectors write to warehouses or search. It runs in standalone mode for one worker or distributed mode for scale and fault tolerance, and mostly needs configuration, not code. Kafka Streams is a client library for processing data already in Kafka: filters, joins, windowed aggregations and local state stores. It runs inside my application, not on the brokers. So a typical pipeline uses Connect to land database changes in Kafka, Streams to enrich and aggregate them, and Connect again to write results to the warehouse.”

Weak answers. Saying Kafka Streams runs on the brokers, or writing custom producers for jobs a standard connector already handles.

14. “Explain KStream versus KTable.”

Why they ask. The stream-table duality is the key idea in Kafka Streams.

Sample answer. “A KStream is a stream of independent events: every record is a new fact, like a page view. A KTable is a changelog view: each record is an update to the latest value for its key, like a user’s current address. The Kafka Streams docs model this duality explicitly with KStream, KTable and GlobalKTable. An aggregation can take a KStream or a KTable as input, but its output is always a KTable, which lets Streams emit an updated value when late, out-of-order records arrive. GlobalKTable copies the full table to every instance, which is useful for small lookup data joined without repartitioning. The docs put it simply: a stream is a changelog of a table, and replaying that changelog rebuilds the table.”

Weak answers. “A KTable is a database table,” without the changelog idea or why aggregations output tables.

Prepare for Streams questions with OphyAI: rehearse the duality in Interview Practice with a concrete example, like clicks joined to user profiles.

15. “What is KRaft, and what happened to ZooKeeper?”

Why they ask. It checks that your knowledge is current, since older tutorials still describe ZooKeeper.

Sample answer. “KRaft is Kafka’s built-in metadata quorum, proposed in KIP-500 to replace ZooKeeper. Instead of a separate ZooKeeper ensemble, a set of Kafka controllers stores cluster metadata in an internal Raft-based log. Each server’s process.roles setting makes it a broker, a controller or both. Kafka 4.0, released in March 2025, was the first major release to run entirely without ZooKeeper, and the current release line is 4.4, from October 2026. That means simpler operations: one system to deploy, secure and monitor. The upgrade notes say clusters in ZooKeeper mode have to be migrated to KRaft before they can be upgraded to 4.x. In an interview I’d also mention that ZooKeeper-era settings and tools may not apply anymore.”

Weak answers. “Kafka needs ZooKeeper for leader election,” which is out of date for every 4.x cluster.

16. “What are share groups, and when would you use one instead of a consumer group?”

Why they ask. It is the newest big feature, and it tests whether you understand why consumer groups are not a work queue.

Sample answer. “Share groups, from KIP-932 and often called Queues for Kafka, let consumers cooperatively consume a topic without the one-consumer-per-partition rule. The docs list the differences: a partition can be shared by several consumers, the number of consumers can exceed the number of partitions, records are acknowledged individually, and delivery attempts are counted so a bad record can be handled automatically. Early access arrived in 4.0, a preview in 4.1, and the 4.2 announcement in February 2026 called it production-ready. I’d use it for job-style work where throughput matters more than order, like independent tasks with uneven processing times. I’d keep consumer groups wherever per-key ordering matters, since share groups give that up.”

Weak answers. Not knowing the feature exists, or claiming share groups keep per-partition ordering.

How to Practice These

Say each answer aloud in under two minutes in OphyAI Interview Practice, which runs voice or text mock interviews with follow-up questions, a transcript and per-answer feedback, in behavioral, technical, system design and case formats. On a live video round, OphyAI Interview Copilot gives real-time answer suggestions with a live transcript on Zoom, Microsoft Teams and Google Meet. For the coding and design rounds, Coding Copilot in the desktop app (Premium plan, $59 a month, 15 credits a session) snaps the problem window with Cmd/Ctrl+Shift+A, and in a live interview transcribes the question the interviewer asks aloud when you press Space or Cmd/Ctrl+Shift+L. Each answer card shows how it read the problem, what to say first, the code, a dry run and the Big O, in an overlay left out of screen sharing. Hiding a window from screen share does not hide it from a webcam, a person in the room, keystroke and paste history, tab or focus tracking, or proctoring and lockdown software. There is no $9 OphyAI plan: the Basic plan was retired in July 2026. Start practicing →

Kafka usually appears inside a larger pipeline or architecture round. Pair this page with the data engineer interview questions (batch versus streaming, backfills, Airflow), the system design interview guide and, for standalone design prompts, our system design interview questions page. Most Kafka client code in interviews is Java, so the Java interview questions are worth a pass too.

Frequently Asked Questions

What Kafka topics are asked most in interviews?

Partitions and ordering, offsets and consumer groups, delivery semantics, acks with min.insync.replicas, replication and the ISR, and exactly-once with transactions come up in most loops. Senior roles add rebalances, consumer lag debugging, log compaction and Kafka Streams state. Current-platform questions now cover KRaft and share groups, since Kafka 4.x removed ZooKeeper.

Which Kafka version should I prepare for?

Prepare for Kafka 4.x. Apache Kafka 4.4.0 was released on October 22, 2026, and 4.0 in March 2025 was the first major release without ZooKeeper. Know what changed: KRaft only, the KIP-848 consumer rebalance protocol, share groups, and linger.ms defaulting to 5 milliseconds instead of 0. Many employers still run 3.x clusters, so ask in the interview.

Do I need to know ZooKeeper for a Kafka interview?

Know enough to explain what it did (cluster metadata and controller election) and why KRaft replaced it under KIP-500. You do not need ZooKeeper operations detail for a 4.x role. If the job description mentions an older cluster or a migration, prepare the migration path: the upgrade notes say ZooKeeper-mode clusters have to be migrated to KRaft before upgrading to 4.x, and recommend 3.9.x as the step for KRaft clusters older than 3.3.

Is Kafka asked in data engineer or backend engineer interviews?

Both, with a different focus. Data engineer loops lean on Connect, Streams, exactly-once to a warehouse, backfills and schema evolution. Backend loops lean on ordering, idempotent consumers, retries, and event-driven service design. Read the job description: if it names Kafka, expect at least one question on delivery guarantees and one design question that uses it.

How do I answer Kafka schema evolution questions?

Name the tool and the rule. With Confluent Schema Registry, each schema version gets an ID, and the registry checks compatibility before accepting a new version. Its default mode is BACKWARD, meaning consumers using the new schema can read data written with the last schema. Then explain safe changes, such as adding an optional field with a default.

What is a good Kafka design answer in a system design round?

Start from the guarantees the product needs: ordering per what key, how much loss is acceptable, and whether duplicates are harmless. Then size partitions for parallel consumers, set replication factor 3 with min.insync.replicas 2 and acks=all for durable data, choose delete or compact retention, and say how consumers stay idempotent. Close with lag monitoring and replay.

How does OphyAI work in a Kafka interview?

Use Interview Practice to rehearse concept and design answers aloud, with follow-up questions, a transcript and per-answer feedback. On a live Zoom, Microsoft Teams or Google Meet round, Interview Copilot gives real-time answer suggestions and a live transcript. For live coding and system design, Coding Copilot in the desktop app is on the Premium plan.

Company guides where streaming, event data and backend design questions show up:

Related question guides:

Sources and verification notes

Checked November 2026 (on November 24). All technical claims come from the Apache Kafka 4.4 documentation and the official release announcements, read directly, plus Confluent’s Schema Registry documentation for schema evolution. Configuration defaults are quoted from the 4.4 configuration pages and can differ on older clusters. “Weak answers” and interview topic lists are our own guidance, not data. We cite no popularity or usage statistics.

Tags:

kafka interview questions apache kafka interview data engineer interview backend interview technical interview

Rehearse your answers, then get live help on the call.

Practice free for up to 15 minutes, then use Interview Copilot in the OphyAI desktop app: real-time answer suggestions on Zoom, Teams and Google Meet, in a window hidden from screen sharing.

Hidden from screen share and recording; a webcam or a person in the room can still see your screen.