Optiver interview question

Design a fast solution for this problem statement