Kafka is deceptively simple to start and full of sharp edges around ordering and delivery. These questions check whether a candidate understands its guarantees.
Hiring a Apache Kafka developer is easy. Telling a real one from a convincing résumé is the hard part — and it’s most of what we do. These are grouped by level, because the same question that stretches a junior is a warm-up for a senior.
Junior Apache Kafka interview questions
0–2 years
Core concepts.
What is Kafka and what is it used for?
A distributed, durable event-streaming platform for publish/subscribe messaging, event pipelines and stream processing at scale.
Thinks it’s just a message queue like a simple broker.
What are topics and partitions?
A topic is a named stream of records; it’s split into partitions for parallelism and scale, each an ordered append-only log.
Doesn’t know partitions are the unit of parallelism.
What is a producer and a consumer?
Producers write records to topics; consumers read them, tracking their position via offsets.
Confuses their roles.
What is an offset?
A monotonically increasing id of a record’s position within a partition, used by consumers to track progress.
Thinks Kafka deletes messages once read.
What is a consumer group?
A set of consumers sharing work: each partition is consumed by one member, enabling horizontal scaling.
Expects every consumer in a group to get every message.
Does Kafka delete messages after they’re consumed?
No — it retains records by time or size regardless of consumption, so multiple consumers can read independently.
Assumes reading removes the message.
What is a broker?
A Kafka server storing partitions and serving reads/writes; a cluster of brokers provides scale and replication.
No idea where data physically lives.
What is the role of keys in a message?
The key determines the partition (same key to the same partition), giving per-key ordering.
Sends everything with no key and loses ordering guarantees.
Mid-level Apache Kafka interview questions
2–5 years
Delivery and ordering.
What ordering guarantees does Kafka provide?
Ordering is guaranteed within a partition, not across a topic; per-key ordering comes from keyed partitioning.
Expects global ordering across a topic.
What are the delivery semantics (at-most/at-least/exactly-once)?
At-least-once is the common default (retries can duplicate); exactly-once is achievable with idempotent producers and transactions.
Assumes exactly-once for free.
How does replication work?
Each partition has a leader and follower replicas; producers/consumers talk to the leader, and followers provide durability and failover.
Runs with a replication factor of one in production.
What is a consumer offset commit and why does it matter?
Committing marks how far a consumer has processed; commit timing determines whether failures cause reprocessing or loss.
Commits before processing and loses messages on failure.
How do you scale consumers?
Add consumers to a group up to the partition count; beyond that, extra consumers sit idle, so partition count bounds parallelism.
Adds more consumers than partitions expecting more throughput.
Why is idempotency important for consumers?
Because at-least-once delivery can redeliver, consumers must handle duplicates safely (idempotent processing or dedup).
Assumes each message is processed exactly once.
What is acks on the producer?
Controls durability: acks=all waits for in-sync replicas (safe), acks=0/1 trade durability for latency.
Uses acks=0 for critical data.
What causes consumer rebalancing and why care?
Membership or partition changes trigger reassignment, pausing consumption; frequent rebalances hurt throughput.
Ignores rebalances causing processing stalls.
Senior Apache Kafka interview questions
5+ years
Reliability and design.
How do you achieve exactly-once processing?
Idempotent producers, transactions spanning produce-and-commit, and idempotent or transactional consumers — with awareness of its cost and scope.
Claims exactly-once without transactions or idempotency.
How do you choose a partition count?
Balance parallelism and throughput against overhead and rebalancing cost; it’s hard to reduce later, so plan for growth.
Picks a partition count arbitrarily.
How do you handle poison messages and failures?
Retries with limits and a dead-letter topic so one bad record doesn’t block the partition.
Lets a bad message block the whole partition indefinitely.
How do you prevent and handle consumer lag?
Monitor lag, scale consumers/partitions, optimise processing, and ensure consumers keep up with production rate.
No visibility into lag until consumers fall far behind.
When is Kafka the wrong tool?
For simple request/reply, low-volume task queues, or when you need per-message acknowledgement semantics a queue provides more simply.
Uses Kafka for everything, including simple job queues.
How do you design topic and schema evolution?
A schema registry with compatibility rules so producers and consumers evolve without breaking each other.
Changes message formats and breaks consumers.
How do you tune for throughput vs latency?
Batching, compression and linger.ms for throughput; smaller batches and lower acks latency for responsiveness — a deliberate tradeoff.
Leaves defaults and can’t explain the throughput/latency balance.
How does log compaction differ from retention?
Time/size retention deletes old records; compaction keeps the latest value per key, useful for changelog/state topics.
Confuses compaction with simple deletion.
Build and score a full interview with our free interview scorecard tool, browse the full question hub, or see how we interview engineers.