Philips interview question

Data structure and problem solving.