Code Room
Code reviewMediumcr-g620
Subject Storage temp file leakLevel Mid–Senior~18 minCommon in Storage & CDN interviewsIndustries Software development

Question

Review this Python image-processing route that uses a temp file on disk.

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 reviewpython
import tempfile, os def process_image(upload):    fd, tmp = tempfile.mkstemp(suffix=".png")    with os.fdopen(fd, "wb") as f:        f.write(upload.read())    result = run_filter(tmp)        # may raise on malformed images    os.remove(tmp)    return result
Run or narrate your approach, then ask the coach.