📨 Section 15 · 30 questions

Kafka

30 interview questions and answers in the Kafka section.

Questions in this section

  1. What is Topic in Kafka
  2. What is Partition and Why is It Needed
  3. How is Data Distributed Across Partitions
  4. What is Message Key and How Does It Affect Partitioning
  5. What is Consumer Group
  6. How Does Consumer Balancing Work in a Group
  7. Can You Have More Consumers Than Partitions
  8. What Happens When You Add a New Consumer to the Group
  9. What Message Delivery Guarantees Does Kafka Provide
  10. What is the Difference Between At-Most-Once, At-Least-Once and Exactly-Once
  11. How to Configure Exactly-Once Semantics
  12. What is Offset in Kafka
  13. How Does Offset Commit Work
  14. What is the Difference Between Auto Commit and Manual Commit
  15. What is Rebalancing and When Does It Happen
  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
  20. What is Producer Acknowledgment and What Modes Exist (acks=0, 1, all)
  21. What is Batch in Kafka Producer
  22. How Does Message Compression Work
  23. What is Idempotent Producer
  24. How to Handle Errors When Reading Messages
  25. What is DLQ (Dead Letter Queue)
  26. How to Monitor Consumer Lag
  27. What is Retention Policy
  28. How are Old Messages Deleted from a Topic
  29. Can You Read Messages from a Specific Partition
  30. 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

# Question Difficulty
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 ⭐⭐
05 What is Consumer Group ⭐⭐
06 How Does Consumer Balancing Work in a Group ⭐⭐
07 Can You Have More Consumers Than Partitions ⭐
08 What Happens When You Add a New Consumer to the Group ⭐⭐
09 What Message Delivery Guarantees Does Kafka Provide ⭐⭐
10 What is the Difference Between At-Most-Once, At-Least-Once and Exactly-Once ⭐⭐
11 How to Configure Exactly-Once Semantics ⭐⭐⭐
12 What is Offset in Kafka ⭐
13 How Does Offset Commit Work ⭐⭐
14 What is the Difference Between Auto Commit and Manual Commit ⭐⭐
15 What is Rebalancing and When Does It Happen ⭐⭐⭐
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 ⭐⭐
20 What is Producer Acknowledgment and What Modes Exist (acks=0, 1, all) ⭐⭐
21 What is Batch in Kafka Producer ⭐⭐
22 How Does Message Compression Work ⭐⭐
23 What is Idempotent Producer ⭐⭐⭐
24 How to Handle Errors When Reading Messages ⭐⭐
25 What is DLQ (Dead Letter Queue) ⭐⭐
26 How to Monitor Consumer Lag ⭐⭐
27 What is Retention Policy ⭐⭐
28 How are Old Messages Deleted from a Topic ⭐⭐
29 Can You Read Messages from a Specific Partition ⭐⭐
30 How to Implement Message Filtering on Consumer Side ⭐⭐

🗺️ 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     │
                    └──────────────────────────────────────────┘

🟢 Junior Track (Core Messaging & Concepts)

🟡 Middle Track (Offset Management, Replication & Error Handling)

🔴 Senior Track (Exactly-Once Semantics, Log Compaction & Custom Protocols)