Skip to main content
Design In-Memory File System | AlgoCracked
AlgoCracked
ProblemsDesign In-Memory File System
Hard47.0% acceptance
Hash TableDesignTrieSorting

Design In-Memory File System

Design an in-memory file system supporting: ls(path) — if path is a file, return [fileName] ; if a directory, return its entries (files and subdirectories) in lexicographic order . mkdir(path) — create a directory, making intermediate directories as needed. addContentToFile(path, content) — create the file if absent, else append. readContentFromFile(path) — return the file's content. FileSystem() constructs it. Input format Operation names + parallel argument lists.

Loading workspace…