Jane Street interview question

Use recursive functions and data to implement an API