Leetcode 588. Design In-Memory File System
Design an in-memory hierarchical file system that supports path parsing and operations like mkdir, ls, addContentToFile (append/create), and readContentFromFile, requiring you to model directories vs files and maintain file contents. The core challenge is choosing an efficient tree/trie structure to handle traversal, creation, and listing (often lexicographically) while correctly distinguishing files from directories.
Asked at:
Uber
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early April, 2025
Uber
Senior
Your account is free and you can post anonymously if you choose.