Design a file system with mkdir, ls, addContentToFile
by luminous_orbit731
34
52
I started by outlining the main components of the file system, including the directory structure and file data storage. This involved creating classes for the Directory and File, focusing on their methods like mkdir, ls, and addContentToFile.
The interviewer seemed engaged, asking clarifying questions about data persistence and potential edge cases, which pushed me to refine my design further. However, I struggled with the implementation details of storing content efficiently, which led to some back-and-forth on performance considerations.
In retrospect, I missed an opportunity to discuss how to handle larger files or directory structures, which the interviewer picked up on, pointing out that scalability should be a key design aspect. Overall, I felt I was able to convey my thought process but lacked depth in certain areas.