In-Memory File System
Design and implement an in-memory file system that supports adding, deleting, and copying files across directories, while tracking the total size of all files in the system.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late June, 2026
Senior
Early June, 2026
Senior
Level 1: Support the following methods 1. boolean addFile(filePath, size): adds a file with the given size 2.boolean deleteFile(filePath): deleted the file if present 3. getTotalSize: get total size of all the files present in the filesystem Level 2: Add a method to copy a file to a given destination directory, handle edge cases like file with the same name is already present in the destination directory
Early June, 2026
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.