Optiver Interview Question

Design a fast solution for this problem statement