Microsoft Interview Question

Given a file hierarchy, write an algorithm to traverse the hierarchy and process data in the file system.