Optiver interview question

Coding up a short software solution on a whiteboard.