Design a file system with mkdir, ls, addContentToFile

by ethereal2186
OpenAI
mid
coding
medium
rejected
34
67

I started the interview by outlining a basic structure for the file system, detailing how to implement mkdir, ls, and addContentToFile. I proposed a tree-like structure to represent directories and files, and explained how I'd use a hash map for efficient retrieval of file contents.

The interviewer seemed engaged and asked several probing questions about how I'd handle edge cases, like creating directories with the same name or adding content to a non-existent file. I struggled a bit with some specific implementation details regarding concurrency in file access, which led to some back-and-forth that didn't feel very productive.

Overall, while I communicated the core concepts well, my inability to fully address concurrency concerns seemed to hinder my performance.


Markdown supported