Trees & BSTs
LinkedIn asks four tree problems often enough that each one is worth preparing on its own. Three are on its tagged list, and candidates mention them from both the phone screen and the onsite. The fourth has no LeetCode page. It comes up in senior and Staff onsites, and about half of that prompt is designing the node type yourself.
Most of the score in these rounds comes from the follow-ups. One problem starts on a binary search tree and then takes the ordering away. Another accepts an in-order traversal as a first answer, but candidates who stayed at O(n) after the interviewer asked for O(log n + k) got lean-hire verdicts. Write the base version so the next step fits on top without a rewrite.
LinkedInPremium lesson · Coding round
The 4 LinkedIn problems are below.
- A Premium questionCoding · Hard · Frequently asked
- A Premium questionCoding · Medium
- A Premium questionCoding · Medium
+ 1 more in this lesson
Each with hints, the follow-up and a tested solution.
Get the LinkedIn questions$49 a year · all 100 companies · cancel anytime
From 1,074 LinkedIn reports, forum threads behind logins and write-ups in Chinese.
LinkedIn interview guideKnow what LinkedIn asks before you walk in.
28 coding · 5 system design · 26 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.