File System Implementation
Harvey AI interview questions · Medium · Coding round · reported 7× · 6 tests
Implement an in-memory hierarchical file system.
Interface
class FileSystem {
addFolder(path: string): string;
addFile(path: string, content?: string | null): string;
getFile(path: string): string[] | string | null;
}
Rules
Run your code with Ctrl+Enter to see results.