Kafka - Basics and Event StreamingGiven a Kafka topic with 3 partitions and 2 consumers in the same group, how many partitions will each consumer read from?AEach consumer reads from all 3 partitionsBOne consumer reads 2 partitions, the other reads 1 partitionCEach consumer reads from 1 partition onlyDConsumers cannot share partitionsCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand Kafka consumer group partition assignmentKafka assigns partitions evenly among consumers in the same group.Step 2: Distribute 3 partitions among 2 consumersOne consumer will get 2 partitions, the other 1 partition.Final Answer:One consumer reads 2 partitions, the other reads 1 partition -> Option BQuick Check:Partition distribution = uneven but balanced D [OK]Quick Trick: Kafka partitions split evenly among consumers [OK]Common Mistakes:Assuming all consumers read all partitionsThinking partitions can't be sharedIgnoring uneven partition counts
Master "Basics and Event Streaming" in Kafka9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kafka Quizzes Consumer Groups - Consumer group concept - Quiz 10hard Kafka Basics and Event Streaming - First message (produce and consume) - Quiz 8hard Kafka Cluster Architecture - ZooKeeper role (and KRaft replacement) - Quiz 8hard Kafka Cluster Architecture - ZooKeeper role (and KRaft replacement) - Quiz 3easy Kafka Cluster Architecture - Leader election - Quiz 6medium Producers - Serialization (String, JSON, Avro) - Quiz 8hard Producers - Batching and linger configuration - Quiz 11easy Topics and Partitions - Retention policies (time-based, size-based) - Quiz 11easy Topics and Partitions - Topic creation - Quiz 14medium Topics and Partitions - Retention policies (time-based, size-based) - Quiz 9hard