HSBC Interview Question

how to sort files under tags based on the data within the file?