Jane Street Interview Question

Code a stack machine to follow list of instructions.