Code Room
Code reviewHardcr-g483
Subject Boxing overheadLevel Senior–Staff~22 minCommon in Code quality & review interviewsIndustries Software development, Technology

Question

Review this Go metrics aggregator on a hot path.

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
func record(metrics map[string]interface{}, name string, v float64) {    metrics[name] = v   // float64 boxed into interface{}} func total(metrics map[string]interface{}) float64 {    var sum float64    for _, raw := range metrics {        sum += raw.(float64)   // type assertion per entry    }    return sum}
Run or narrate your approach, then ask the coach.