In-Memory File System

Asked at Harvey · Coding Questions · Difficulty: Medium · Last asked May 15, 2026

Implement an in-memory file system with addFile(path) and getFile(path): adding stores a file at a slash-delimited path (creating folders as needed), and getFile returns either a file's contents or the folder at that path. Follow-ups cap entries per directory, auto-rename duplicate filenames, and detect identical file contents.

Loading the problem…