Amazon Interview Question

File System design question in Python