Code Room
Code reviewHard
Question
Review this Go function that prices a bill of materials by recursively expanding sub-assemblies. Deep trees with shared sub-assemblies are extremely slow.
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.
Learn the concepts
func cost(part string, bom map[string][]string, price map[string]float64) float64 { total := price[part] for _, child := range bom[part] { total += cost(child, bom, price) } return total}Run or narrate your approach, then ask the coach.