๐Ÿ”ฅ Launch Offer: Interview Preparation Bundle @ โ‚น2,499 โ‚น9,999 โ€ข 75% OFF. Offer expires in ๐Ÿ”ฅ Launch Offer: Interview Preparation Bundle @ โ‚น2,499 โ‚น9,999 โ€ข 75% OFF. Offer expires in Interview Preparation Bundle @ โ‚น2,499 โ‚น9,999

00:00:00 Get Bundle
home kafka kafka-quick-recap
Interview guide Kafka 10 sections

Kafka Quick Recap

Producer โ†“ Topic โ†“ Partitions โ†“ Consumer Group โ†“ Consumers 1. Producer Publishes messages/records to Kafka. Can publish to one or multiple topics. Producer doesn't own partitions. Kafkaโ€ฆ

Start reading
By javainterviewprep August 11, 2026 2 min read
Producer
   โ†“
Topic
   โ†“
Partitions
   โ†“
Consumer Group
   โ†“
Consumers

1. Producer

  • Publishes messages/records to Kafka.
  • Can publish to one or multiple topics.
  • Producer doesn’t own partitions.
  • Kafka decides which partition receives the record.
Producer โ†’ Topic A
         โ†’ Topic B
         โ†’ Topic C

2. Topic

  • Logical category/name for messages.
  • A topic contains one or more partitions.
order-events
 โ”œโ”€โ”€ P0
 โ”œโ”€โ”€ P1
 โ””โ”€โ”€ P2

3. Partition

  • Actual place where Kafka stores records.
  • Records have offsets within a partition.
  • Ordering is guaranteed within a partition, not across the whole topic.
P0 โ†’ Offset 0, 1, 2, 3, 4...

4. Offset

  • Position of a record inside a partition.
  • Offset starts from 0.
  • Current Offset usually represents the next position to read.
Records:  0  1  2  3  4  5
Next:                         6

So if:

Current Offset = 6
Log-End Offset = 6
Lag = 0

the consumer is caught up.

5. Consumer

  • Reads records from Kafka.
  • Can consume from multiple topics.
  • Kafka assigns partitions to consumers.
Consumer โ†’ P0
         โ†’ P1

6. Consumer Group

  • A team of consumers working together.
  • A consumer group can consume from multiple topics.
  • Within the same consumer group:

One partition โ†’ only one consumer at a time.

Example:

inventory-group

Consumer 1 โ†’ P0, P1
Consumer 2 โ†’ P2

7. Multiple Consumer Groups

Different groups can consume the same topic/partition independently.

                 order-events
                /      |      \
               P0     P1      P2
                โ”‚       โ”‚       โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚                                  โ”‚
inventory-group                    analytics-group
       โ”‚                                  โ”‚
   Consumers                          Consumers

8. Scaling Rule โญ

3 partitions + 1 consumer
โ†’ consumer handles all 3

3 partitions + 3 consumers
โ†’ each can handle 1

3 partitions + 5 consumers
โ†’ 2 consumers will be idle

Maximum useful parallelism within one consumer group = number of partitions.

The 7 things to remember

ConceptRemember
ProducerPublishes records
TopicCategory/logical stream
PartitionStores ordered records
OffsetRecord position in partition
ConsumerReads records
Consumer GroupConsumers working together
LagRecords still waiting to be consumed

โญ One-line mental model

Producer publishes โ†’ Topic contains partitions โ†’ Partitions contain records with offsets โ†’ Consumer Groups consume those partitions โ†’ Consumers are assigned partitions.