Design Google Drive

Cloud file storage and sharing platform supporting upload, download, sync, and collaboration for billions of files across devices.

Functional requirements

  • Users can upload files of any size from web, mobile, and desktop clients.
  • Large files are split into chunks and uploaded in parallel via a resumable protocol.
  • Users can download files from any device; downloads are accelerated by a CDN.
  • Files are organised into nested folder hierarchies with inherited permissions.
  • Users can share files or folders with others using role-based access (owner, editor, commenter, viewer) or via expiring shared links.
  • File changes are synchronised across all connected devices in near real time.
  • Every file version is retained; users can browse history and restore any prior version.
  • Users can search for files by name, type, and full-text content.
  • Post-upload processing — thumbnail generation, virus scanning, search indexing — runs asynchronously without blocking the upload response.
  • Deleted files are moved to Trash and can be recovered within a configurable retention window before permanent deletion.

Non-functional requirements

  • Durability: file bytes must be stored with 99.999999999% (11-nines) durability using multi-AZ replication in object storage.
  • Availability: the service must achieve 99.99% uptime; no single component failure should make files inaccessible.
  • Scalability: the upload and download paths must independently scale to serve 1 billion+ files and millions of concurrent users.
  • Performance: file listing and metadata reads must complete in under 100 ms (p99) for cache-warm requests; CDN-served downloads must complete in under 200 ms (p99) globally.
  • Latency: ACL permission checks must add no more than 5 ms to any file operation, served from an in-memory cache.
  • Resumability: interrupted uploads must be resumable from the last successful chunk for up to 24 hours without restarting.
  • Consistency: metadata operations (rename, share, delete) must be strongly consistent; search index and thumbnail delivery may be eventually consistent within 30 seconds.
  • Security: all data must be encrypted in transit (TLS 1.2+) and at rest (AES-256); access tokens must be short-lived and rotated; all file accesses must be authorised against ACLs.
  • Isolation: virus-scanning workers must execute in isolated sandboxes; a compromised file must not affect other users' data.
  • Geo-distribution: files must be downloadable from edge nodes closest to the user; cross-region replication must tolerate a full regional failure with no data loss.
  • Observability: all upload, download, share, and delete events must be logged with user ID, timestamp, and outcome for audit and compliance.

How the design evolves

Stage 1: MVP — Upload and Download

Start with the bare minimum: a single server and database for metadata, plus blob storage for file bytes.

Stage 2: Edge, CDN, and Rate Limiting

Add a CDN for fast global downloads, a load balancer as edge ingress, and rate limiting to protect the upload API.

Stage 3: Horizontal Scaling and Metadata Cache

Scale app servers behind a load balancer and add a metadata cache to absorb hot folder/permission reads.

Stage 4: Async Processing — Thumbnails, Virus Scan, Search

Decouple post-upload work (thumbnails, virus scanning, search indexing) using a queue and workers so uploads stay fast.

Stage 5: Production Hardening — Replication, Versioning, and Sync

Add DB replication, a versioning service for file history, and a notification service for multi-device sync.

Frequently asked questions

How do you handle large file uploads reliably?

Split files into chunks (e.g. 5–10 MB each) and upload them in parallel or sequentially. Each chunk is written to blob storage independently. A resumable upload session tracks which chunks have been received so a failed upload can resume from the last successful chunk rather than starting over.

How do you prevent two users from overwriting the same file simultaneously?

Use optimistic concurrency — tag each file version with an ETag or version number. On write, the client sends the version it last saw; the server rejects the write if the current version doesn't match, forcing the client to fetch the latest and re-apply its changes. For collaborative editing, operational transformation or CRDTs handle fine-grained conflict resolution.

How do you sync file changes across multiple devices in real time?

After every write, publish a change event to a notification service (e.g. via Server-Sent Events or WebSocket). Each connected device listens for events matching its user ID and re-fetches the changed metadata on receiving one. Delta sync — sending only the changed bytes — reduces bandwidth compared to re-downloading the full file.

How would you implement file deduplication to save storage?

Compute a content hash (e.g. SHA-256) of every chunk before storing it. Before writing a chunk to blob storage, check if an identical hash already exists. If it does, store only a pointer to the existing chunk. This is content-addressable storage — the same bytes are stored once regardless of how many users have uploaded identical files.

How do you model and enforce file sharing permissions?

Store permissions as an Access Control List (ACL) in the metadata database — each entry maps a (file_id, user_id/group_id) pair to a role (owner, editor, commenter, viewer). Cache hot ACLs in Redis. On every file operation, check the calling user's role. Link-based sharing generates a signed URL or a token that encodes the permission level and expiry.

When would you shard the metadata database?

Shard when the primary metadata DB can no longer handle write throughput or when the dataset no longer fits on a single node. Shard by user_id so all of a user's files live on the same shard — this keeps folder-listing queries local and avoids cross-shard joins. Add routing logic in the application layer to map user_id to the correct shard.

How do you ensure file durability and protect against data loss?

Object storage like S3 or GCS stores at least 3 copies of every object across different availability zones by default. Durability is typically 11 nines (99.999999999%). For extra protection, enable cross-region replication so a regional outage doesn't make data unavailable. Version history means deleted or overwritten files can be recovered within a retention window.

How do you make file search fast across billions of files?

After a file is uploaded, a worker indexes its name, MIME type, owner, and extracted text (for documents) into a dedicated search index like Elasticsearch. Queries run against the index rather than the metadata database. The index is updated asynchronously so it doesn't block uploads. Shard the index by user_id or org_id to keep queries isolated.

PRISM
System Design Interview
Round 1 of 4 · Architecture Design · 60:00 remaining
PRISM logo
AI Interview
Interview Prep
Interview Challenges
Design Your Own System NEW
System Architectures
Interactive Roadmap System Design Guides
Notifications
  • No new notifications
Feedback
Signed in
Phase
Design Your Own System
Phase 01: Thinking in Systems
Upcoming

Components

User
CDN
Load Balancer
Server
Cache
Database
Blob Storage
Search Index
Queue
Worker
Rate Limiter
Service
API Gateway
Reverse Proxy
WebSocket Server
Third-party API

Inspector

Notes
Use clear names so your design intent is easy to understand.
Good
Name by business meaning
"Order API", "Restaurant Service"
Avoid
Generic names = zero signal
"Server 1", "API", "Queue"
A short description for each component makes feedback much better.
100%
Start by identifying:
  • Users & entry points
  • APIs & services
  • Databases & storage
  • Traffic flow & scale

Round 1 of 4 Architecture Design

Run a simulation to see results.

Time Remaining
60:00
System Design Interview

What are the core functional requirements?
What are the key non-functional constraints?

Questions

Start Evaluation to unlock questions.

Components Added
No components listed
Click "+ Add" to document components introduced in this stage.
Design Decisions

Click Simulate to run your design and see results here.

Internal notes — not shown to learners.

EVALUATE MODE

Test yourself like it's the real thing.

A structured 4-module evaluation that mirrors how top companies assess system design candidates.

Architecture Design
Draw your system on the canvas. Define components, connections, and data flow.
FR & NFR Requirements
Answer functional and non-functional requirement questions about your design.
MCQ Round
Multiple choice questions testing your depth on the chosen system.
Tradeoff Analysis
Justify your design decisions and defend your architectural tradeoffs.
AI Report Generated
A R S
Used by engineers preparing for FAANG & top-tier companies
Choose a Problem
No problem selected
  • 30 min
  • 45 min
  • 60 min
Round 2 of 4
MCQ Round
Answer multiple-choice questions based on your design.

Exit Interview?

You're in the middle of an interview session. Leaving now will end your current attempt.

Your progress will be saved.

Open a saved design

Select a design to load into the canvas.

My Evaluations

Your past evaluation sessions

Here’s a simple request flow that follows the expected layer order.

External User
→
Edge CDN → API Gateway → Load Balancer
→
Compute App Servers / Services
→
DataAccess Cache
→
Storage Database / Search Index
→
Async Queue → Worker

Tip: keep arrows moving forward through layers (Edge → Compute → Storage). Avoid sending storage back to compute.

Evaluation Instructions

Read the rules carefully before starting. The test auto-submits on refresh.

Before you start

  • Build your architecture on the canvas. The timer starts when you click Start Evaluation.
  • Don't forget to answer Functional Requirement and Non Functional Requirements.
  • When satisfied with your design, click Next to lock it and view the questions.
  • Please answer final step questions to complete the evaluation.

Dos

  • Do read each question carefully before answering.
  • Do include required components to maximize component coverage.
  • Do save a copy of your design if you want to keep it before submission.

Don'ts

  • Don't refresh or close the tab during an active evaluation — this will auto-submit your answers.
  • Don't switch app modes or open another tab while the evaluation is running.
  • Don't attempt to edit the design after clicking Next; the workspace will be locked.

All the best!!

Confirm

Input

Notice

Evaluation Report:

Evaluation Complete

Generating Your Report

Hang tight — our AI is evaluating your design…

Did you know?

Loading…

Share feedback

Tell us what worked well and what we can improve.

Let's personalize this

Answer a couple of quick questions so we can tailor your journey and missions.

You can change this anytime from your Profile.

Your personalized missions are ready

We tailored these first steps based on your answers.

    PRISM Welcome Gift

    This is a personal welcome gift from PRISM.

    Congratulations.

    You explored PRISM.

    You earned Apprentice.

    As a welcome gift, unlock Full PRISM Access for the configured trial duration.

    This starts Trial. Trial timer begins only after you activate this gift.

    Welcome to PRISM

    We've prepared a personalized Apprentice Journey based on your goals and experience.

    This journey introduces you to the capabilities of PRISM that are most relevant to you.

    Complete all 8 missions to earn your Apprentice title. 8 MISSIONS

    PRISM Surprise Offer

    Complete your Apprentice Journey to unlock a special gift from PRISM.

    • No payment required
    • No credit card required
    • Just complete the journey
    MISSION CONTROL
    0 / 8 missions complete
    NEXT UP Continue your missions
    View full roadmap →
    Mission Complete 0 / 8 Completed Next: Keep going
    SYSTEM BRIEF

    ⬤ System Constraints

    What the system must do — every item is a user-facing behaviour your architecture must support.

      ↑ Engineering Constraints

      These are the failure modes you must design against — latency SLAs, durability targets, traffic ceilings.

        ⇆ Architecture Constraints

        ◈ Core Concepts to Master

        Your Journey
        PHASE – –
        0 / 0 0%
        0
        Mock Interview Checklist

        Pick a topic to start

        Explore concept overviews, real-system examples, key tradeoffs, and interview talking points for each roadmap section.

        Topic-Wise Progress
        Experience Points 0 XP
        Read subtopics & solve challenges to earn XP
        Theory Read +0 XP
        Solved +0 XP
        Streak Bonus +0 XP
        Theory Read 0%
        — Mastered — Solved
        Weekly Streak 0 day streak
        Mon
        Tue
        Wed
        Thu
        Fri
        Sat
        Sun
        Keep going — log in daily to build your streak!
        0 0%
        Skill Profile
        Recommended Next
        🎯 Your Focus

        You haven't explored enough yet.

        Focus on
        → Understanding System Design
        → Estimating Scale
        Next Action
        Continue → Next: –
        Mock Interview Checklist
        Architecture DNA
        Engineering Profile
        Phase Mastered

        You've conquered this phase. These are the skills you now own:

          +500 XP

          Engineering Profile

          Company Interview Paths

          Progress Summary