KatInterview

Build a Cloud Storage System with Chunked Uploads and Permissions

System DesignModel answer
MediumModel answerSystem Designstoragedistributed-systemsapi-design

Last updated

Architect a file-hosting platform separating content from metadata, supporting granular access rules and resumable multi-part uploads.

You're building a cloud storage platform similar to modern file-hosting services. Users need to upload files of any size, share them selectively, and download them reliably. Your architecture must handle interrupted uploads gracefully and enforce fine-grained access control.

Requirements

  • Users authenticate and manage their own files
  • Files may be arbitrarily large; network interruptions during upload should allow resuming from the last successful piece rather than restarting
  • Owners can grant or revoke access to specific users
  • The system should prevent incomplete or corrupted files from appearing in user listings

Design Considerations

Think through these architectural questions as you design:

  • How do you represent files independently from their stored bytes?
  • Where and when do you verify upload permissions versus download permissions?
  • What identifier strategy prevents collisions when a file is overwritten?
  • How do you ensure only complete, validated files become visible to users?

What to Design

Section A — Storage Schema and Authorization

Propose data models for file records, content storage, and permission rules. Explain how you check authorization when a user lists their files, shares a file, or initiates a download.

Section B — Multi-Part Upload Flow

Detail the lifecycle of uploading a large file in pieces: session initialization, transferring individual segments with retry support, and finalizing the upload. Address orphaned temporary data.

Section C — Download Path and Consistency

Describe how an authorized user retrieves file content. Explain how you handle scenarios where blob storage succeeds but metadata updates fail, or vice versa.

Hints

Hint 1

Consider separating the file record users see from the immutable blob where bytes live—this lets you handle versions and atomic visibility transitions

Hint 2

For chunked uploads, track which segments have arrived successfully so clients can skip them on retry; a manifest listing all chunks enables validation before marking the file complete

Hint 3

Authorization should gate both metadata operations and blob access; signed URLs or short-lived tokens let clients read blobs without embedding permanent credentials