Code Room
Code reviewMediumcr-g081
Subject Missing cacheLevel Mid–Senior~25 minCommon in Storage & CDN · Networking & APIs interviewsIndustries Software development

Question

Review this Go HTTP handler serving a rarely-changing config blob.

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 configHandler(w http.ResponseWriter, r *http.Request) {    cfg, err := loadConfigFromDB()   // ~50ms, changes a few times a day    if err != nil {        http.Error(w, "error", 500)        return    }    b, _ := json.Marshal(cfg)    w.Header().Set("Content-Type", "application/json")    w.Write(b)}
Run or narrate your approach, then ask the coach.