InterviewLegend

Trees & Graphs

Alex Chen32 min readUpdated 309 real interview reports

Intuit's trees-and-graphs round is a standard one. The problems sit in the easy-to-medium band, the shapes are the ones every list drills, and no signature trick is waiting to catch you. The bar is craftsmanship. What the round grades is whether the traversal you write is clean, handles the empty and single-node cases, and compiles and runs the first time. A hierarchy of accounts, a category tree, a grid of cells: each is a small graph underneath, and the same short walk solves most of them.

Almost everything in this family runs off one skeleton: a depth-first or breadth-first walk that remembers where it has been. A tree lets you drop the memory, because it has no cycles and every node has exactly one parent. A graph or a grid puts it back, since an edge can point in a circle and two paths can reach the same cell. Make that one distinction reflexive and the cluster mostly collapses into the same loop with different bookkeeping.

The Intuit angle
The algorithm is the smaller half of an Intuit tree question, so write it as production code, not as a race. Reports from the assessor and problem-solving rounds line up. The panel wants a fully compiling solution in Java, with edge cases handled. Often they want the same traversal twice, once recursively and once iteratively, because the follow-up to "find the height" is routinely "now do it without recursion." Clarify the shape of the input before you touch the keyboard, since the interviewers like to withhold a detail and watch whether you ask for it. Name the empty tree, the single node, and the null child out loud, then handle them. A correct, readable walk that clears its boundaries beats a clever one that trips on a missing child.
What's inside
  • 3 problems, worked step by step
  • about 32 min

Premium lessonIntuit interview guide

These took digging.

What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.

100 companies. Checked every month.

Unlock all 100 companies

$49 a year · less than $1 a week · Cancel anytime

Had your Intuit interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Intuit interview guide

Know what Intuit asks before you walk in.

15 coding · 5 system design · 21 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.