MidStorage

Design durable, highly available storage for user-uploaded images. Which service do you choose and why?

What they are really testing: Whether you reach for the right primitive (object storage) instead of bolting files onto a server or database, and whether you think about durability, access, and cost, not just "where do the bytes go".

A real interview question

Design durable, highly available storage for user-uploaded images. Which service do you choose and why?

What most people say

drag me

I would store the images on the EC2 instance’s disk, or as blobs in the database.

Local disk dies with the instance and breaks horizontal scaling; blobs in a relational DB bloat it, wreck backups, and are expensive. Both miss that object storage is the purpose-built primitive.

The follow-ups they ask next

  • How do you stop users uploading 5GB files or malware through your pre-signed URLs?

    Constrain the pre-signed URL (content-length-range, content-type, short expiry); validate/scan on an upload event (S3 event -> Lambda) before marking the object usable; reject oversize/disallowed types.

  • Images load slowly for users in another continent. What do you do?

    A CDN with edge caching is the fix (CloudFront); ensure cache headers are set so objects are actually cached at the edge; consider cross-region replication only if origin latency, not edge caching, is the bottleneck.

What the interviewer is listening for

  • Chooses object storage and says why
  • Direct client access via pre-signed URLs
  • Adds a CDN; thinks about cost lifecycle

What sinks the answer

  • Stores files on instance disk
  • Blobs in a relational DB
  • Bucket public to "make it work"

If you genuinely do not know

Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.

I’d use [object storage, S3] for [durability + unlimited + stateless compute]. Clients go direct via [pre-signed URLs], with [a CDN in front] for latency. Bucket is [private, encrypted, public access blocked], plus [lifecycle tiering for cost].

Keep going with storage

All 336 cloud engineer questions

Knowing the answer is not the same as recalling it under pressure

Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.

Start free