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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late July, 2026
Late June, 2026
Early June, 2026
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
Hello Interview Premium
Your account is free and you can post anonymously if you choose.