Last updated: 25 November 2026
Short answer: Kafka interviews test partitions and ordering, consumer groups and offsets, delivery guarantees (acks, idempotence, transactions) and how you debug lag and retries. Freshers get the basics. With 2–5 years, you get configs and trade-offs. Senior rounds are failure scenarios. Below are 35 questions with short answers. In a Weekday analysis of 400 top Reddit posts from the last 30 days, interview rounds and assessments came up in 93. On 25 November 2026, Weekday listed 3,068 open data engineer jobs, and in backend listings Kafka was named far more often than any other message broker we checked.
Know the version story before you walk in. Kafka 4.0 (March 2025) was the first major release to run entirely without ZooKeeper, in KRaft mode (Apache Kafka). Kafka 4.2 (February 2026) made Queues for Kafka production-ready (Apache Kafka). Kafka 4.4, released in October 2026, is the newest line (endoflife.date). If your answers still mention ZooKeeper as a must-have, interviewers will notice.
What Kafka interviewers actually test
We read the first 1,000 listings on Weekday's data engineer jobs page and the first 996 on its backend developer jobs page on 25 November 2026, counting mentions in titles, skill tags and summaries.
| Skill | Data engineer listings (of 1,000) | Backend listings (of 996) |
|---|---|---|
| Databricks | 163 | not counted |
| SQL | 137 | not counted |
| Spark | 50 | not counted |
| Streaming or real-time | 23 | not counted |
| Kafka | 13 | 33 |
| RabbitMQ | not counted | 1 |
| SQS, Kinesis, Pulsar or Pub/Sub | not counted | 0–1 each |
Summaries are short, so these are floor numbers. Two takeaways. Data engineering interviews lean on SQL and Spark first, with Kafka as the streaming piece. In backend roles, Kafka is the default message broker, so expect deep questions about consumers and failure handling.
Failure handling is where real systems break. A r/cscareerquestions thread with 1,048 upvotes (link) described an engineer asked back to a company after a string of outages, one of them a retry storm from a Kafka consumer nobody on the team understood any more. That's question 27 below, and panels love it. Rounds are long, too: a r/jobs thread asking "Is this normal? 9 round interviews???" drew 659 comments.
Kafka interview questions for freshers
1. What is Kafka?
A distributed event streaming platform. Producers write events to topics, Kafka stores them durably as an ordered, replicated log, and consumers read them at their own pace. Many consumers can read the same data.
2. What are topics, partitions and offsets?
A topic is a named stream, like orders. It's split into partitions so it can scale. Each message in a partition gets an offset, its position number, which consumers use to track progress.
3. What are brokers and controllers?
Brokers store partitions and serve reads and writes. Controllers manage cluster metadata, like which broker leads each partition. Since Kafka 4.0, controllers run a Raft quorum called KRaft, with no ZooKeeper.
4. What is a consumer group?
Consumers sharing a group.id. Each partition goes to one consumer in the group, so the group splits the work. With 6 partitions and 8 consumers, 2 sit idle. Different groups each get all the data.
5. Does Kafka guarantee order?
Only within a partition. Messages with the same key go to the same partition (while the partition count stays the same), so key by what needs ordering, like order_id.
6. How long does Kafka keep data?
Until retention runs out, by time (retention.ms; the broker default is 168 hours, or 7 days) or by size. Reading doesn't delete anything. Compacted topics keep the latest value per key instead.
7. What are replication factor, leader and ISR?
Replication factor is how many copies each partition has. One replica is the leader and handles reads and writes; followers copy it. In-sync replicas (ISR) are those fully caught up with the leader.
8. Show the basic CLI commands.
kafka-topics.sh --bootstrap-server localhost:9092 --create \
--topic orders --partitions 6 --replication-factor 3
kafka-console-producer.sh --bootstrap-server localhost:9092 --topic orders
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic orders --from-beginning
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group billing
Since 4.0, tools use --bootstrap-server. The old --zookeeper option is gone.
9. Kafka vs RabbitMQ?
Kafka is a log: messages stay after reading, many groups can replay them, and it handles very high throughput. RabbitMQ is a broker with flexible routing where messages are usually removed once acknowledged. Use Kafka for event streams and replay; RabbitMQ for task queues with complex routing.
10. What is an offset commit?
The consumer saving how far it has read, in the internal __consumer_offsets topic. By default, enable.auto.commit is true and commits every 5 seconds, which can lose or repeat messages if the consumer crashes mid-batch.
11. Why is Kafka fast?
Sequential disk writes, the OS page cache, batching and compression, and zero-copy transfer to consumers (when TLS isn't in the way). Partitions spread the load across brokers.
12. What does auto.offset.reset do?
It decides where a consumer starts when it has no committed offset: latest (default, only new messages), earliest (from the start) or none (throw an error).
Kafka interview questions for 2–5 years
13. What do acks=0, 1 and all mean?
0: don't wait for the broker. 1: wait for the leader only. all: wait for all in-sync replicas. Since Kafka 3.0, producers default to acks=all with idempotence on.
14. How does min.insync.replicas work with acks=all?
It sets how many in-sync replicas must confirm a write. With replication factor 3 and min.insync.replicas=2, you can lose one broker and keep writing. Lose two, and producers get NotEnoughReplicas errors instead of silent data loss.
# producer
acks=all
enable.idempotence=true
# topic
replication.factor=3
min.insync.replicas=2
15. At-most-once, at-least-once or exactly-once?
At-most-once: commit before processing, so a crash can lose messages. At-least-once: commit after processing, so a crash can repeat them; make processing idempotent. Exactly-once: idempotent producer plus transactions, within Kafka.
16. What does the idempotent producer do?
The broker tracks a producer ID and sequence numbers per partition and drops duplicates caused by retries. It also keeps order with up to 5 in-flight requests per connection.
17. How do Kafka transactions work?
Set a transactional.id, then write to several partitions and commit consumer offsets with sendOffsetsToTransaction in one atomic step. Downstream consumers must set isolation.level=read_committed to skip aborted data.
18. What triggers a rebalance, and how do you reduce the pain?
Consumers joining, leaving, crashing or missing the poll deadline. Use the cooperative-sticky assignor and static membership (group.instance.id). Kafka 4.0 made the new consumer group protocol generally available; consumers opt in with group.protocol=consumer, which makes rebalances incremental and broker-driven.
19. What is consumer lag?
The gap between the latest offset in a partition and the group's committed offset. Check it with kafka-consumer-groups.sh --describe or export it to Prometheus. Alert on lag that keeps growing, not on one spike.
20. What do max.poll.interval.ms and max.poll.records control?
If you don't call poll() within max.poll.interval.ms (default 5 minutes), the consumer is kicked out of the group. max.poll.records (default 500) caps a batch. Slow processing plus big batches equals rebalance loops.
21. How many partitions should a topic have?
Enough for your target throughput and the number of consumers you need in parallel, with room to grow. You can add partitions but never remove them, and adding them changes which partition a key maps to.
22. What is log compaction?
With cleanup.policy=compact, Kafka keeps at least the latest value for each key. Good for "current state" topics like user profiles. A message with a null value (a tombstone) deletes the key.
23. What is a hot partition?
One partition getting far more traffic because a few keys dominate, like one big merchant. Fix by choosing a better key, adding a suffix to spread a hot key, or handling that key separately.
24. Kafka Connect, Kafka Streams and Schema Registry?
Connect moves data in and out of Kafka with ready connectors, like a database CDC source or an S3 sink. Streams is a Java library for stateful processing. Schema Registry (from Confluent, not part of Apache Kafka) stores Avro, Protobuf or JSON schemas and enforces compatibility.
25. Write an at-least-once consumer loop.
props.put("enable.auto.commit", "false");
try (KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props)) {
consumer.subscribe(List.of("orders"));
while (true) {
ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(500));
for (ConsumerRecord<String, String> r : records) {
process(r); // must be safe to run twice
}
consumer.commitSync(); // commit only after processing
}
}
Senior and scenario questions
26. Consumer lag is growing fast. How do you debug it?
Check if it's all partitions (consumers too slow) or a few (hot keys or a stuck consumer). Look for rebalance loops in logs, slow downstream calls and GC pauses. Fixes: scale consumers up to the partition count, process in parallel within a partition by key, batch database writes, or add partitions.
27. A bad message causes a retry storm. How do you design against it?
Don't retry forever in place. Retry a few times with backoff, then send the message to a retry topic with a delay, and finally to a dead letter topic with the error attached. Make processing idempotent, alert on the dead letter topic, and add a circuit breaker for a failing downstream service.
28. How do you get exactly-once between Kafka and a database?
Kafka transactions don't cover your database. Use idempotent writes, like an upsert keyed by event ID, or store offsets in the same database transaction as the data. For the other direction, use the outbox pattern: write the event to an outbox table with the business change, then publish it with CDC.
29. A broker dies. What happens?
The controller elects new leaders for its partitions from the in-sync replicas, and clients reconnect. If no in-sync replica is left, the partition stays offline. unclean.leader.election.enable is false by default, which picks durability over availability.
30. How do you move a ZooKeeper-based cluster to Kafka 4.x?
Kafka 4.0 can't run in ZooKeeper mode, so you migrate to KRaft on 3.x first (3.9 is the last 3.x line), then upgrade (Apache Kafka upgrade notes). Also check clients: Kafka 4.0 dropped very old protocol versions and needs Java 11 for clients and Java 17 for brokers.
31. How do you keep order with retries?
Keep idempotence on. It preserves order with up to 5 in-flight requests. Without it, set max.in.flight.requests.per.connection=1 or a retry can land after a later message.
32. How do you set up disaster recovery across regions?
Replicate topics with MirrorMaker 2 to a second cluster, including consumer offset translation. Decide active-passive or active-active, agree RPO and RTO, and run failover drills. Remember that replication is async, so some data can be lost on failover.
33. When would you use Queues for Kafka?
For work queues where you want more consumers than partitions and per-message acknowledgement, like sending notifications. Share groups, production-ready since 4.2, give you that. Use regular consumer groups when you need strict order per partition.
34. Size a cluster for 50,000 messages a second.
At 1 KB each, that's about 50 MB/s, or 4.32 TB a day. Three days of retention is about 13 TB. With replication factor 3, plan around 39 TB of disk, plus headroom for growth and spikes. Then check network and partition counts per broker.
35. How do you secure Kafka?
TLS for encryption in transit, SASL (SCRAM or OAUTHBEARER) for authentication, ACLs for topic and group permissions, and quotas so one client can't starve others. Keep secrets out of client config files.
A 2-week Kafka interview prep plan
| Days | Focus | Do this |
|---|---|---|
| 1–2 | Basics | Run Kafka 4.x locally in KRaft mode; create topics, produce and consume |
| 3–4 | Consumer groups | Run 3 consumers on 6 partitions; kill one and watch the rebalance |
| 5–6 | Delivery guarantees | Try acks and min.insync.replicas with a broker down |
| 7–8 | Failure handling | Build retry and dead letter topics for a poison message |
| 9–10 | Ecosystem | Stream a database table with a Connect CDC source; add a schema |
| 11–12 | Monitoring | Track lag in Grafana; create lag on purpose and fix it |
| 13–14 | Mock rounds | Answer 26–35 out loud and size one cluster on paper |
For the rest of the loop, see our microservices interview questions and AWS data engineer interview questions.
What Kafka skills pay
Weekday's data engineer salary guide, built from salaries shared at 25 companies, puts the typical company median at ₹8 LPA for 2–3 years and ₹9.5 LPA for 4–6 years, with senior data engineers at ₹16.8 LPA. Open roles that show pay sit higher: on 25 November 2026, the 31 data engineer listings on Weekday with a disclosed salary had a median of ₹26 LPA. Most openings want experience: 835 asked for 4–6 years and 87 for 0–1 year.
Free tool: Paste a job description into Weekday's Interview Question Predictor to see which questions that role is likely to ask.
Find data engineer roles hiring now
Weekday lists thousands of open data engineer roles, updated daily, with quick-apply jobs shown first. Filter by city, work mode and experience.
Frequently asked questions
What are the most common Kafka interview questions?
Topics, partitions and offsets, consumer groups, ordering, acks and min.insync.replicas, delivery guarantees, consumer lag, rebalancing, and how you'd handle a poison message or a broker failure.
Does Kafka still need ZooKeeper?
No. Kafka 4.0 removed ZooKeeper mode, and all 4.x releases run on KRaft. ZooKeeper clusters must migrate to KRaft on 3.x before upgrading.
What is the latest Kafka version?
Kafka 4.4, released in October 2026. Kafka 4.2 made Queues for Kafka (share groups) production-ready.
Is Kafka asked in data engineer interviews?
Often, but after SQL and Spark. On Weekday, Kafka appeared in 13 of the first 1,000 data engineer listings and 33 of 996 backend listings, while RabbitMQ appeared in 1 backend listing.
Sources
- Weekday data engineer jobs and backend developer jobs (25 Nov 2026; first 1,000 and 996 listings read for skill counts; median pay from 31 listings)
- Weekday analysis of 400 top Reddit posts from the last 30 days (Nov 2026): r/jobs 9-round thread, r/cscareerquestions thread (paraphrased)
- Apache Kafka 4.0.0 release announcement
- Apache Kafka 4.2.0 release announcement
- Apache Kafka 4.0 upgrade notes
- endoflife.date: Apache Kafka releases
- Weekday: Data engineer salary in India




