Validate BFS order queries on a tree | Rubrik Interview Question