Your code passes.Now explain it out loud.
Practice coding interviews with Alex, a voice interviewer who reads your code as you type, asks the follow-up, and scores how you think.
“The AI interviewer was more helpful when I got stuck than what I experienced in my last two interviews.”
Maximum Depth of Binary Tree
Guided practice, 24 minutes
A recursive DFS that passed every example. Weighed DFS against BFS before coding, and tightened space complexity to O(h) under questioning.
Correct, clean, and passes every example. What separates it from a 9 is the pattern: passing depth down works, but it isn't the idiomatic recursive shape for trees.
All three examples passed on the first run.
Discussed trade-offs before writing code. The space complexity answer wasn't complete until Alex asked for it.
“Unless the tree is super wide, a breadth-first search tends to be more performant.”
Clear, structured walkthrough once the code was done. Hesitated when Alex traced node 9, then recovered.
“Traverse is the recursive function. The first thing we do is the earliest exit condition, then we check whether we're at a leaf.”
Took Alex's suggestion for a cleaner pattern and ran with it. One defensive moment while clarifying a trace, but willing to reconsider throughout.
“I see. So in that world, would I even need the traverse function inside of maxDepth?”
A debrief that shows you how to level up.
From Two Sum to Word Ladder II.
Pick a problem, then pick how much help you want.
Follow-ups as you go, and a nudge when you've been stuck a while.
Start free.
Free
Try it out, no commitment
- 1 practice interview
- 3 coding challenges
- Real-time coaching from Alex
- Performance report after each session
- Keep your reports & profile forever
Pro
For when interviews are on the calendar
- Unlimited practice interviews
- Unlimited coding challenges
- Performance reports with scoring
- Resume-based personalization