Skip to content
Kafka Is FunProgress

Kafka Interview Questions

140 questions with reference answers. Open a question, write your answer, and the evaluator shows which expected concepts you covered and which you missed — then compare against the reference.

Beginner40 questions

  1. #1What is Apache Kafka and what problem does it solve?
  2. #2What is a Kafka topic and how is it different from a traditional queue?
  3. #3What is a partition in Kafka and why are they important?
  4. #4What is an offset in Kafka?
  5. #5What is the role of a Kafka broker?
  6. #6What is a consumer group?
  7. #7What is the difference between at-most-once, at-least-once, and exactly-once delivery?
  8. #8What is the replication factor?
  9. #9What are acks in Kafka producer configuration?
  10. #10What is the High Watermark (HWM)?
  11. #11What is consumer lag?
  12. #12How do you increase the throughput of a Kafka consumer?
  13. #13What does auto.offset.reset=earliest vs latest do?
  14. #14What is enable.auto.commit and why is it dangerous?
  15. #15What is Kafka's data retention and how is it configured?
  16. #16What is the difference between Kafka and RabbitMQ?
  17. #17What is a Kafka producer and how does key-based partitioning work?
  18. #18How does Kafka guarantee message ordering?
  19. #19What are Kafka's built-in compression types?
  20. #20What is a dead letter queue (DLT) in Kafka?
  21. #21What is the ISR (In-Sync Replicas) set?
  22. #22What is ZooKeeper's role in traditional Kafka and what replaced it?
  23. #23What is the default log retention period in Kafka?
  24. #24How do you view Kafka consumer group lag?
  25. #25What is min.insync.replicas and when does it matter?
  26. #26What is a Kafka record/message structure?
  27. #27What happens when a Kafka broker goes down?
  28. #28What is log compaction and when would you use it?
  29. #29What is the difference between kafka-console-producer and kafka-console-consumer?
  30. #30What serialization formats are commonly used with Kafka?
  31. #31What is a Kafka broker's bootstrap.servers configuration?
  32. #32What are Kafka's port conventions?
  33. #33How does a consumer know which offset to start from?
  34. #34What is Kafka Streams?
  35. #35What is Kafka Connect?
  36. #36What is the difference between Kafka's @KafkaListener and manual polling?
  37. #37What is Schema Registry?
  38. #38What is the purpose of the __consumer_offsets topic?
  39. #39What is the kafka-topics.sh tool used for?
  40. #40Why can't you have more consumers in a group than partitions?

Intermediate30 questions

  1. #41Explain the producer request lifecycle with acks=all in detail.
  2. #42What is the difference between LEO and HWM? Why does it matter for consumers?
  3. #43How does Kafka handle leader election when a broker fails?
  4. #44How would you tune a Kafka producer for maximum throughput?
  5. #45What causes consumer rebalancing and how can you minimize it?
  6. #46What is the difference between Kafka's request queue and the Purgatory?
  7. #47How do you safely perform a rolling upgrade of a Kafka cluster?
  8. #48What is the significance of max.in.flight.requests.per.connection in relation to ordering?
  9. #49Explain the Kafka controller's responsibilities in KRaft mode.
  10. #50What is the OS page cache and why does it matter for Kafka performance?
  11. #51How does Kafka use sendfile() for zero-copy transfer?
  12. #52What is partition reassignment and when do you need it?
  13. #53What is the difference between sticky and cooperative sticky partition assignment?
  14. #54How do you prevent consumer lag from growing under high load?
  15. #55What is Kafka's log segment and why does it matter?
  16. #56How would you debug a 'LEADER_NOT_AVAILABLE' error in production?
  17. #57What is unclean leader election and why is it dangerous?
  18. #58What is the significance of num.partitions for a topic?
  19. #59How do you reset consumer offsets to reprocess messages?
  20. #60What is Kafka's inter-broker replication protocol?
  21. #61How does Kafka guarantee message ordering with multiple producers?
  22. #62What is the impact of increasing Kafka's JVM heap size?
  23. #63What is Kafka's wire protocol and how does versioning work?
  24. #64What are the main JMX metrics to monitor for a healthy Kafka cluster?
  25. #65How does a Kafka producer handle a NOT_LEADER_OR_FOLLOWER error?
  26. #66How does Kafka achieve low latency with acks=all?
  27. #67What is rack awareness in Kafka and why is it important?
  28. #68What is Kafka's RecordAccumulator and how does it buffer messages?
  29. #69How do you handle message schema evolution in Kafka?
  30. #70What is the difference between Kafka's Fetch API and consumer.poll()?

Advanced20 questions

  1. #71Explain Kafka's exactly-once semantics implementation end-to-end.
  2. #72What is the Kafka Raft (KRaft) consensus algorithm and how does it differ from ZooKeeper's ZAB?
  3. #73How does Kafka handle log truncation during replica recovery?
  4. #74What is the epoch fencing mechanism in Kafka transactions?
  5. #75How does Kafka's TimingWheel work and why is it used in Purgatory?
  6. #76Explain the Kafka consumer's heartbeat threading model and how it relates to max.poll.interval.ms.
  7. #77What is Kafka's sparse index format and how does binary search work on it?
  8. #78How would you diagnose and fix high producer latency (P99 > 500ms)?
  9. #79What is the Outbox Pattern and how does Kafka enable it?
  10. #80How would you implement the Saga pattern using Kafka?
  11. #81Explain event sourcing with Kafka. What are the trade-offs?
  12. #82What is the __transaction_state topic and how does it work?
  13. #83How would you handle a Kafka cluster with millions of partitions?
  14. #84What is the Kafka Mirror Maker 2 (MM2) and how does multi-cluster replication work?
  15. #85Explain the Kafka consumer group coordinator and rebalance protocol in detail.
  16. #86How does Kafka handle backpressure from slow consumers?
  17. #87What is CQRS with Kafka and how is it different from event sourcing?
  18. #88How does Kafka's compaction work internally? What is the cleaner thread?
  19. #89What is the effect of fsync on Kafka performance and when should you configure it?
  20. #90How would you design a Kafka-based event-driven microservices architecture?

Spring30 questions

  1. #101How do you configure a Kafka consumer in Spring Boot?
  2. #102How do you produce messages with KafkaTemplate?
  3. #103How do you configure retry and dead letter topics in Spring Kafka?
  4. #104How do you configure Kafka transactions in Spring Kafka?
  5. #105How do you set up manual offset commits in Spring Kafka?
  6. #106What is the difference between concurrency and partitions in Spring Kafka's listener container?
  7. #107How do you handle deserialization errors in Spring Kafka?
  8. #108How do you implement a batch @KafkaListener in Spring Kafka?
  9. #109What is spring.kafka.consumer.isolation-level and when do you need it?
  10. #110How do you test Kafka listeners in Spring Boot?
  11. #111How do you configure Spring Kafka for JSON serialization with type information?
  12. #112What is SeekToCurrentErrorHandler (now DefaultErrorHandler) in Spring Kafka?
  13. #113How do you configure multiple @KafkaListener annotations for the same topic with different group IDs?
  14. #114What is spring.kafka.listener.missing-topics-fatal?
  15. #115How does @KafkaListener handle partition assignment and offset control?
  16. #116What is the KafkaAdmin bean and how do you use it to manage topics?
  17. #117How do you write a Spring Kafka integration test without external Kafka?
  18. #118How do you configure the consumer to start from the beginning for a new application deployment?
  19. #119What is spring.kafka.listener.ack-mode RECORD vs BATCH vs MANUAL?
  20. #120How does Spring Kafka's @RetryableTopic differ from Spring Retry's @Retryable?
  21. #121How do you implement request-reply pattern with Spring Kafka?
  22. #122What is the difference between ProducerFactory and KafkaTemplate in Spring Kafka?
  23. #123How do you use Kafka headers in Spring Kafka?
  24. #124How do you configure consumer listener concurrency for optimal throughput?
  25. #125What happens if a @KafkaListener throws an uncaught exception?
  26. #126How do you configure Spring Kafka consumer groups for multi-tenancy?
  27. #127What is the difference between DefaultErrorHandler and CommonErrorHandler in Spring Kafka?
  28. #128How do you configure Spring Kafka for Avro with Confluent Schema Registry?
  29. #129What is spring.kafka.streams and how do you use Kafka Streams in Spring Boot?
  30. #130How do you control the number of messages processed per @KafkaListener invocation?

Scenario20 questions

  1. #141Your Kafka cluster shows UnderReplicatedPartitions > 0. Walk through your debugging steps.
  2. #142A consumer group suddenly shows 100,000 messages of consumer lag. How do you respond?
  3. #143You're seeing duplicate messages in your consumer application. How do you identify the source and fix it?
  4. #144How do you safely add a new topic and deploy a new consumer without downtime?
  5. #145A production broker runs out of disk space. What happens and how do you recover?
  6. #146Your Spring Boot Kafka consumer stops consuming after processing a malformed message. How do you fix it?
  7. #147How do you migrate a Kafka topic to a new cluster with zero data loss?
  8. #148Design a Kafka topic schema for an e-commerce order processing system.
  9. #149A Kafka Streams application is falling behind. How do you scale it?
  10. #150How do you implement exactly-once delivery in a Kafka-to-database pipeline?
  11. #151What would you check first if consumers are reading the same messages multiple times after a deployment?
  12. #152Design a high-throughput event ingestion pipeline with Kafka.
  13. #153A Kafka producer is experiencing high p99 latency. List 5 potential causes and fixes.
  14. #154How would you implement an audit log system using Kafka?
  15. #155Explain how you'd handle a multi-region Kafka deployment for disaster recovery.
  16. #156How do you handle schema evolution when you have 50 consumers reading a Kafka topic?
  17. #157What's your strategy for monitoring Kafka in production with 100+ topics?
  18. #158How do you safely increase the partition count of an existing Kafka topic?
  19. #159What is the maximum number of consumer groups that can read the same Kafka topic simultaneously?
  20. #160How would you debug a 'Network Exception: Disconnected' error in a Kafka producer?