Bird
0
0

Given a Kafka topic with 4 partitions and a consumer group with 2 consumers, how many partitions will each consumer read from?

medium📝 Predict Output Q13 of 15
Kafka - Consumer Groups
Given a Kafka topic with 4 partitions and a consumer group with 2 consumers, how many partitions will each consumer read from?
AEach consumer reads from 2 partitions
BEach consumer reads from 4 partitions
CEach consumer reads from 1 partition
DEach consumer reads from 0 partitions
Step-by-Step Solution
Solution:
  1. Step 1: Understand partition assignment

    Partitions are divided among consumers in a group. With 4 partitions and 2 consumers, partitions split evenly.
  2. Step 2: Calculate partitions per consumer

    4 partitions / 2 consumers = 2 partitions per consumer.
  3. Final Answer:

    Each consumer reads from 2 partitions -> Option A
  4. Quick Check:

    Partitions per consumer = total partitions / consumers = 2 [OK]
Quick Trick: Partitions divide evenly among consumers in a group [OK]
Common Mistakes:
  • Assuming each consumer reads all partitions
  • Thinking partitions are not shared
  • Ignoring partition count

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes