Code Room
Code reviewMediumcr-g046
Subject Empty inputLevel Mid–Senior~20 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Go function that returns the maximum of a slice.

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 Max(nums []int) int {    max := 0    for _, n := range nums {        if n > max {            max = n        }    }    return max}
Run or narrate your approach, then ask the coach.