TikTok interview question

Topological sort + binary tree problems