← All problems
Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Problem 010 · Messaging and event-driven systems

Design an Image Thumbnail Service

Easy 35 min

Design the service behind image uploads for a marketplace. Sellers upload photos; the system stores the original and produces three thumbnail sizes. Listing pages show thumbnails to millions of shoppers. Resizing is CPU-heavy and sometimes fails on corrupt files.

Functional requirements

  • Upload an original image
  • Generate three thumbnail sizes
  • Serve thumbnails on listing pages
  • Report failed images to the seller

Non-functional requirements

  • Uploads return in under 500 ms (resizing happens later)
  • No uploaded original is ever lost
  • A burst of uploads must not slow down browsing

Constraints and scale

  • 2 million uploads per day, bursts of 500 per second
  • Shoppers view 30 000 thumbnails per second
  • Originals average 4 MB

You will practise

  • Move slow work off the request path with a queue
  • Store blobs in object storage behind a CDN
  • Handle poison messages with a dead-letter queue
Show 2 hints
  1. Does the seller need to wait while thumbnails are generated?
  2. What happens to a corrupt image that crashes the resizer every time?

Ready to build?

Open the canvas, place your components and explain your decisions. Your draft saves automatically.

Sign in to start

Failure scenarios

  • A corrupt image crashes the resizerA malformed file makes the resize library crash every time it is processed.

Run them from the workspace once your design is in place.