Atlassian - File System Design

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2023-11-12Added By Anonymous
Source: Link

Design a file system to support getting the size of any directory.


What could be a better approach for this problem if size of any directory needs to be returned in O(1) ignoring the cost to traverse from root to given directory. Multiple files can be added to the directory and it's sub directories.


How to keep the directory size updated whenever a new content is added to directory.

Comments