Skip to content
RED SAGSkills
mediumFull Stack Developer interview question

How would you build a feature that lets users upload profile photos and PDF documents up to 100 MB?

What the interviewer wants to hear

  • Upload directly to object storage with presigned URLs
  • Validate file type and size on the server
  • Store only metadata and object key in the database
  • Process files asynchronously, such as resizing or virus scanning
  • Serve through a CDN with access control for private files

Model answer

I would not send large files through my API server, because it ties up memory and hits serverless body limits. Instead the client asks my API for an upload URL. The server checks the user is logged in, checks the declared file type and size, and returns a short-lived presigned URL for object storage like S3 or R2. The browser uploads directly to storage, using multipart upload for big files so it can resume. When the upload finishes, the client tells my API, or a storage event triggers it, and I save metadata like the object key, size, type and owner in the database. A background job then checks the real file type, scans for viruses and creates resized images. Public images are served through a CDN, while private PDFs are served with short-lived signed URLs after an authorization check.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium Full Stack Developer questions