BlackRock interview question

Data structure and algorithm problems, quite typical