Design
In-Memory File System
Design an in-memory file system supporting directories, files, and standard operations like create, read, delete, and move.
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.
Apply the Composite pattern to a tree structure
Implement efficient path resolution
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
05 - Companies that ask this
You may face this exact question in your next interview.
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