Optiver interview question

Create functions that simulate communicating with exchanges and avoids short-selling.