All problems
Foundational·🛠️ Developer Tools·Google · Amazon · Microsoft

Design
In-Memory File System

Design an in-memory file system supporting directories, files, and standard operations like create, read, delete, and move.

#OOP#Composite Pattern#Tree
Start Solving 6F + 2NF requirements inside

01 -  Why interviewers ask this

It's the standard vehicle for testing the Composite pattern — files and directories must be treated uniformly, and interviewers watch for whether you special-case directories everywhere instead.

02 -  Where this system exists in the real world

You interact with this design every day.

Virtual file systems in IDEs and cloud drives

Sandboxed/containerized filesystem emulation

File explorer UI backends

03 -  What you'll master

Solve this once. Know it forever.

01

Apply the Composite pattern to a tree structure

02

Implement efficient path resolution

03

Compute aggregate properties (size) recursively

04 -  What you'll design

6 functional · 2 non-functional requirements.

Create, read, update, and delete files

5 more requirements inside

Sign in to unlock the full brief and start designing

Unlock Requirements

05 -  Companies that ask this

You may face this exact question in your next interview.

G
Google
A
Amazon
M
Microsoft

Ready?

Open the canvas.
Design it yourself.

See all requirements, use staged hints, run your code, and compare with community discussions - all on the same canvas.

Start Solving