← Back
00:00

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

Idle