Code RoomOn-the-fly image derivatives
MediumPrep Room Coding #3371

On-the-fly image derivatives

System designStorage & CDNMid–Senior~35 min

Design an on-the-fly image thumbnail/derivative service for an image-heavy product (think Pinterest/Shopify) serving 100K image-derivative requests per second across hundreds of size/crop/format variants (WebP, AVIF, JPEG; smart-crop; DPR variants). Originals live in object storage. You cannot pre-generate every variant — the combinatorial space is huge — but cold-start latency must stay low. Design the request path, caching, and how you avoid the thundering-herd when a viral image's variant is first requested.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify4:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.