Agoda interview question

(1 Hours) Coding: File System Hierarchy Problem