Robinhood Interview Question

2 algo questions and a design question