I was asked to (equivalently) transform binary search tree into array and vice versa. Note that they keep doing gambling with you. You have to bet the number that payoff expectation is positive by your mental math.
Check out your Company Bowl for anonymous work chats.