Meta Interview Question

Lots of tree based questions, some DP