Binary Tree Problems
Binary tree questions in VMware's coding rounds tend to come with a rule attached. Sometimes recursion is off the table. Sometimes a node you're asked about isn't in the tree at all. The walk itself is usually short, so most of your planning goes into the rule.
Before you write code, decide what each call hands back to its parent. It might be a node, or the best sum down one branch. Once that return value is right, the rest is a short traversal. When the interviewer bans recursion, an explicit stack on the heap does the same walk, so practice writing both versions.
The three problems below each come with a rule attached, and one reuses a pass from The Core Coding Round. Your code has to compile and run against the interviewer's tests, so check an empty tree and a single node before you call it done.
VMwarePremium lesson · Coding round
The 3 VMware problems are below.
- A Premium questionCoding · Easy · Frequently asked
- A Premium questionCoding · Medium · Frequently asked
- A Premium questionCoding · Hard
Each with hints, the follow-up and a tested solution.
Get the VMware questions$49 a year · all 100 companies · cancel anytime
From 172 VMware reports, forum threads behind logins and write-ups in Chinese.
VMware interview guideKnow what VMware asks before you walk in.
33 coding · 3 system design · 15 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.