IMC Trading Interview Question

Optimization question along with advanced data structure. Make sure you can write optimal time complexity solutions!