Two Sigma Interview Question

Debugging question and some tree/recursion question