💼 Kafka Interview Q&A
Kafka Interview Q&A: Kafka Quick Facts Table 🎬 Interview Scenario: Why Is Consumer Lag Climbing?
Kafka Quick Facts Table
🎬 Interview Scenario: Why Is Consumer Lag Climbing?
consumer-groups --describe
Blocking Synchronous Call
The consumer lag metric on the dashboard is climbing: 100 → 5,000 → 50,000. This is evidence the consumer is running SLOWER than the producer.
The engineer takes the first step: querying the exact state of that group per partition with kafka-consumer-groups.sh --describe --group order-processing-group.
The output shows the gap between LOG-END-OFFSET and CURRENT-OFFSET (lag) growing evenly across every partition — not a single partition issue, the whole consumer is slow.
The root cause is found: there is a blocking, synchronous external service call inside the listener method for every message — consumption of the whole partition halts while each message is processed.
The fix is applied: consumer instance count is scaled up to match the topic's partition count — 6 consumers for 6 partitions, parallel processing capacity increases 6x.
Final — the lag metric drops quickly toward zero. Interview lesson: adding MORE consumers than partitions creates idle capacity; MATCHING the partition count is what unlocks real parallelism.
How Do You Solve a Consumer Lag Question in an Interview?
First MAKE the metric concrete…
First MAKE the metric concrete: instead of "lag is 50,000", say "the consumer is 50,000 messages BEHIND the producer" — this focuses the listener on impact.
Then describe the DIAGNOSIS step…