Design an In-Memory File System

Problem

Design an in-memory file system supporting files and directories.

Requirements

  • mkdir, addFile, readFile, ls
  • Paths like /a/b/c
  • File content append/read

What evaluators look for

  • Tree of nodes (dir/file) with a clean interface
  • Path resolution
  • Separation of structure vs content

Extension

Add symbolic links and discuss cycle prevention.

added …
LeaderboardSalaryAccount