Code Room
Code reviewHardcr-g106
Subject Partial failureLevel Senior–Staff~30 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Go read-through cache.

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 GetUser(id string) (*User, error) {	if u, ok := cache.Get(id); ok {		return u.(*User), nil	}	u, err := db.LoadUser(id)	if err != nil {		return nil, err	}	cache.Set(id, u, 5*time.Minute)	return u, nil}
Run or narrate your approach, then ask the coach.