Code Room
Code reviewHardcr-g307
Subject IdempotencyLevel Senior–Staff~22 minCommon in Networking & APIs interviewsIndustries Software development, Technology

Question

Review this Go Kafka-style consumer that processes each message and then commits its offset.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewgo
for msg := range messages {    if err := applyCharge(msg.Value); err != nil {        log.Printf("apply failed: %v", err)        continue    }    if err := consumer.Commit(msg); err != nil {        log.Printf("commit failed: %v", err)    }}
Run or narrate your approach, then ask the coach.