📨 Section 15 · 30 questions
Kafka
30 interview questions and answers in the Kafka section.
Questions in this section
- What is Topic in Kafka
- What is Partition and Why is It Needed
- How is Data Distributed Across Partitions
- What is Message Key and How Does It Affect Partitioning
- What is Consumer Group
- How Does Consumer Balancing Work in a Group
- Can You Have More Consumers Than Partitions
- What Happens When You Add a New Consumer to the Group
- What Message Delivery Guarantees Does Kafka Provide
- What is the Difference Between At-Most-Once, At-Least-Once and Exactly-Once
- How to Configure Exactly-Once Semantics
- What is Offset in Kafka
- How Does Offset Commit Work
- What is the Difference Between Auto Commit and Manual Commit
- What is Rebalancing and When Does It Happen
- What is Replication in Kafka
- What are Leader and Follower Replicas
- What is ISR (In-Sync Replicas)
- How Does Kafka Ensure Fault Tolerance
- What is Producer Acknowledgment and What Modes Exist (acks=0, 1, all)
- What is Batch in Kafka Producer
- How Does Message Compression Work
- What is Idempotent Producer
- How to Handle Errors When Reading Messages
- What is DLQ (Dead Letter Queue)
- How to Monitor Consumer Lag
- What is Retention Policy
- How are Old Messages Deleted from a Topic
- Can You Read Messages from a Specific Partition
- How to Implement Message Filtering on Consumer Side
Study navigator
30 essential questions and deep-dive architectural analyses for Junior 🟢, Middle 🟡, and Senior 🔴 Java & Distributed Systems Engineers.
📋 Table of Contents
🗺️ Topic Dependency Map
┌──────────────────────────────────────────┐
│ CORE LOG & ARCHITECTURE (01-08) │
│ 01. Topic Model │
│ 02. Partitioning Fundamentals │
│ 03. Data Distribution │
│ 04. Message Key & Hash Partitioner │
│ 05. Consumer Groups │
│ 06. Partition Balancing │
│ 07. Consumer vs Partition Ratio │
│ 08. Group Scale & Join Protocol │
└──────────────────┬───────────────────────┘
│
┌──────────────────────────┼──────────────────────────┐
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌────────────────────┐
│ OFFSETS & │ │ REPLICATION & │ │ PRODUCER INTERNALS │
│ SEMANTICS │ │ FAULT TOLER- │ │ (20-23) │
│ (09-15) │ │ ANCE (16-19) │ │ 20. ACKS (0,1,all) │
│ 09. Guarantees│ │ 16. Replicas │ │ 21. Batching & Buff│
│ 10. Delivery │ │ 17. Leader/Fol│ │ 22. Compression │
│ 11. EOS Trans │ │ 18. ISR MinSync│ │ 23. Idempotence │
│ 12-14. Offsets│ │ 19. Failover │ │ │
│ 15. Rebalance │ │ │ │ │
└───────┬───────┘ └───────┬───────┘ └────────┬───────────┘
│ │ │
└────────────────────────┼────────────────────────┘
▼
┌──────────────────────────────────────────┐
│ OPERATIONS, DLQ & POLICIES (24-30) │
│ 24. Consumer Error Handling │
│ 25. Dead Letter Queues (DLQ) │
│ 26. Consumer Lag Monitoring │
│ 27-28. Log Retention & Compaction │
│ 29. Manual Partition Assignment │
│ 30. Consumer-Side Record Filtering │
└──────────────────────────────────────────┘
🎯 Recommended Study Tracks
🟢 Junior Track (Core Messaging & Concepts)
- Step 1: Topics & Partitions — 01. What is Topic in Kafka, 02. What is Partition and Why is It Needed, 03. How is Data Distributed Across Partitions, 04. What is Message Key and How Does It Affect Partitioning
- Step 2: Consumer Groups & Offsets — 05. What is Consumer Group, 07. Can You Have More Consumers Than Partitions, 12. What is Offset in Kafka
- Step 3: Reliability Basics — 09. What Message Delivery Guarantees Does Kafka Provide, 20. What is Producer Acknowledgment and What Modes Exist (acks=0, 1, all)
🟡 Middle Track (Offset Management, Replication & Error Handling)
- Step 1: Offsets & Rebalancing — 13. How Does Offset Commit Work, 14. What is the Difference Between Auto Commit and Manual Commit, 06. How Does Consumer Balancing Work in a Group, 08. What Happens When You Add a New Consumer to the Group, 15. What is Rebalancing and When Does It Happen
- Step 2: High Availability & Replication — 16. What is Replication in Kafka, 17. What are Leader and Follower Replicas, 18. What is ISR (In-Sync Replicas), 19. How Does Kafka Ensure Fault Tolerance
- Step 3: Producer Performance & Error Handling — 21. What is Batch in Kafka Producer, 22. How Does Message Compression Work, 24. How to Handle Errors When Reading Messages, 25. What is DLQ (Dead Letter Queue), 26. How to Monitor Consumer Lag
🔴 Senior Track (Exactly-Once Semantics, Log Compaction & Custom Protocols)
- Step 1: Idempotence & Distributed Transactions — 10. What is the Difference Between At-Most-Once, At-Least-Once and Exactly-Once, 11. How to Configure Exactly-Once Semantics, 23. What is Idempotent Producer
- Step 2: Log Segment Architecture & Compaction — 27. What is Retention Policy, 28. How are Old Messages Deleted from a Topic
- Step 3: Advanced Consumer Topologies — 29. Can You Read Messages from a Specific Partition, 30. How to Implement Message Filtering on Consumer Side