hard

Design a File System

Design a file system that supports operations like creating, reading, writing, and deleting files and directories. The file system should handle file permissions, different types of files (text, binary), and provide a hierarchical directory structure.

Suggested time: 45 minutes

Loading the workspace...

About this problem

A file system seems straightforward: directories hold files, files hold data. But beneath that surface lies a rich OOD problem involving recursive data structures, permission enforcement, concurrent access to shared resources, and path resolution through a tree. Let's define what our in-memory file system must do.

What your design needs to cover

  • Create Files and Directories

  • Delete Files and Directories

  • Read and Write File Contents

  • Hierarchical Directory Structure

  • Per-User File Permissions

  • Path-Based Navigation

Key challenges the editorial covers

Learn from other designs

Related problems

Guides