Jane Street Interview Question

To make a stack machine