Tree-based coding interview questions