Code Room
Code reviewMediumcr-g363
Subject Api designLevel Mid–Senior~20 minCommon in Networking & APIs interviewsIndustries Software development

Question

Review this Go response type for a document-processing API. A new requirement needs a third state ('partially processed').

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
type DocStatus struct {    ID        string `json:"id"`    Processed bool   `json:"processed"` // true = done, false = pending} func getStatus(w http.ResponseWriter, r *http.Request) {    d := repo.Get(chi.URLParam(r, "id"))    writeJSON(w, 200, DocStatus{ID: d.ID, Processed: d.Done})}
Run or narrate your approach, then ask the coach.