Watch a full mock coding interview focused on binary tree problems — one of the most common topic areas in Meta and FAANG technical rounds. In this 45-minute session, interviewer Abrar walks a CS student through two progressively harder problems, providing real-time evaluation and actionable feedback.
The interview covers two core binary search tree problems: implementing inorder traversal from scratch using recursion, and finding the inorder successor of a given node in a BST without parent pointers. You'll see the candidate work through edge cases, get stuck on the parent-tracking approach, and ultimately arrive at an elegant O(h) time, O(1) space solution using candidate tracking during BST traversal. This is the type of tree data structures question that comes up repeatedly at Meta, Google, and Amazon.
0:00 Introduction and interview setup
1:15 Problem 1: Inorder traversal of a binary tree
2:30 Clarifying the problem and approach discussion
4:45 Recursive inorder traversal implementation
7:00 Time and space complexity analysis (O(n) time, O(h) space)
9:30 Problem 2: Find inorder successor in a BST
12:00 Breaking down the two main cases
16:45 Case 1: Node has a right subtree
20:30 Case 2: No right subtree — finding the ancestor
25:00 Getting stuck on the parent pointer approach
29:15 Key insight: Candidate tracking during BST traversal
33:00 Coding the optimized solution (O(h) time, O(1) space)
38:00 Testing with edge cases
41:00 Interviewer feedback and performance review
43:30 Tips for improving coding interview structure
Resources:
Inorder Successor in BST (LeetCode): https://leetcode.com/problems/inorder...