Jane Street interview question

Data structure and basic algorithm.