Pergunta de entrevista da empresa Jane Street

Implement a machine with a stack and a memory. Implement a method that takes a list of instructions and executes them on the machine then outputs the last element on the machine's stack. How would you build an OCaml-like syntax using that machine. Now, given an expression in the structure you've built, convert it into a list of instructions that can be run on the machine.

Resposta da entrevista

Sigiloso

11 de fev. de 2013

Never managed to reach the last part as they always kept interrupting and questioning my implementation, despite that I have done this before and I knew what I was doing. In the end, they bragged that they implemented this in functional OCaml in 15 lines compared to my 50-line code.