Trees and Recursion
Trees and recursion account for a good share of the coding problems Chewy candidates name. Intern and new-grad loops keep asking for plain binary search tree work, and phone screens and code tests add a twist or two.
Senior screens lean on backtracking, with follow-ups on what a null input does. Both backtracking problems here use the same recursion, where each call picks an item and hands the rest down. They differ in when a branch gets skipped.
On the tree problems, give each cost in terms of tree height and say what happens when sorted inserts turn the tree into a chain. On all of them, write the base case for an empty tree or a null string before the recursive case.
ChewyPremium lesson · Coding round
The 5 Chewy problems are below.
- A Premium questionCoding · Easy
- A Premium questionCoding · Easy
- A Premium questionCoding · Medium
+ 2 more in this lesson
Each with hints, the follow-up and a tested solution.
Get the Chewy questions$49 a year · all 100 companies · cancel anytime
From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.
Chewy interview guideKnow what Chewy asks before you walk in.
30 coding · 1 system design · 28 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.