Code Room
Code reviewHardcr-g136
Subject Backward compatibilityLevel Senior–Staff~25 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Go enum-serialization change in a public API response.

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
type Status int const (    Pending Status = iota // 0    Active                // 1    Suspended             // 2) func (s Status) MarshalJSON() ([]byte, error) {    return json.Marshal(int(s)) // ships status as a number} // New requirement: insert "Trialing" between Pending and Activeconst (    Pending   Status = iota // 0    Trialing                // 1  <-- inserted    Active                  // 2    Suspended               // 3)
Run or narrate your approach, then ask the coach.