Code Room
Code reviewMediumcr-g609
Subject Storage cache evictionLevel Mid–Senior~18 minCommon in Storage & CDN interviewsIndustries Software development

Question

Review this Python on-disk-blob cache wrapper.

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
class ThumbnailCache:    def __init__(self):        self._cache = {}          # image_id -> bytes     def get(self, image_id, render):        if image_id in self._cache:            return self._cache[image_id]        data = render(image_id)   # decodes + resizes, ~200KB-2MB each        self._cache[image_id] = data        return data
Run or narrate your approach, then ask the coach.