Follow-up · depth 1
How would you test Consumer Groups and Rebalance?
How would you test Consumer Groups and Rebalance?
Answers use simple, clear English.
Quick interview answer
Test Consumer Groups and Rebalance with unit checks for the happy path, integration tests for real I/O boundaries, and load/chaos checks so regressions show up before prod. Core idea: Baseline: Each partition consumed by one consumer in group. Rebalance on member join/leave — can cause duplicate processing if offsets not committed carefully.
Detailed answer
Interview answer for testing Consumer Groups and Rebalance: 1) Unit: isolate the pure logic behind Consumer Groups and Rebalance with deterministic fixtures. 2) Integration: exercise real timers/I/O/network boundaries the way production does. 3) Load & soak: prove the event path still meets SLOs under concurrency. 4) Failure injection: break dependencies and assert recovery/backpressure. Best practices to include: Idempotent consumers; static membership; cooperative sticky assignor. Call out mistakes: Long processing without pause; committing before side effects complete. Parent context: Baseline: Each partition consumed by one consumer in group. Rebalance on member join/leave — can cause duplicate processing if offsets not committed carefully.
Full explanation
Interviewers want a test strategy, not “I would write tests.” Tie each layer back to how Consumer Groups and Rebalance fails: correctness, latency, and starvation. Each partition consumed by one consumer in group. Rebalance on member join/leave — can cause duplicate processing if offsets not committed carefully.
Follow-up questions
Only answered follow-ups are shown — click to open with full answers
Parent context — Consumer Groups and Rebalance
Baseline: Each partition consumed by one consumer in group. Rebalance on member join/leave — can cause duplicate processing if offsets not committed carefully.
View full parent question →