Whiteboard Confidential

Delete Nodes and Return Forest: Python Interview with a Google Engineer


Listen Later

REPLAY EPISODE: In this Google coding interview mock, a candidate tackles one of the trickiest binary tree problems that keeps showing up in real interviews.


🧩 Problem: Given the root of a binary tree and a list of node values to delete, remove those nodes and return the roots of all remaining subtrees. (LeetCode #1110 – Delete Nodes and Return Forest)

Watch how the candidate breaks it down from scratch:

âś… Clarifies the problem and edge cases like a real Google interview

âś… Designs an O(n) BFS solution (with clean logic)

âś… Codes in Python and tests multiple tricky examples

âś… Gets detailed interviewer feedback on problem-solving, communication, and structure

💡 What you’ll learn:

• How to think out loud in a Google interview

• BFS vs DFS strategies for tree deletion problems

• How to handle “delete and return forest”–type graph problems

• What great communication looks like under pressure


👉 Sign up to book coaching or to watch more interviews in our showcase: https://www.interviewing.io

đź”— Or view other Google interviews: https://interviewing.io/mocks?company=googleDisclaimer: All interviews are shared with explicit permission from the interviewer and the interviewee, and all interviews are anonymous. interviewing.io has the sole right to distribute this content.

...more
View all episodesView all episodes
Download on the App Store

Whiteboard ConfidentialBy interviewing.io