Trees Interview Questions

127+ real questions from verified interview reports across 12 companies.

Sourced from 1Point3Acres, Blind, Glassdoor, Reddit, and more. Translated and cleaned.

127
Questions
12
Companies
12
Top Askers

Top Companies Asking Trees Questions

Sample Trees Questions

It was my first big tech interview. First question: Remove duplicates from an array. In my nervousness, I initially came up with an O(n) solution before the O(n²) solution. Then she asked me to write

Question Robinhood is famous for its referral program. It\u2019s exciting to see our users spreading the word across their friends and family. One thing that is interesting about the program is...

For onsite, I was asked an algorithms question similar to this: Users can refer each other to Robinhood. We want keep track of who is responsible for the most referrals and...

They asked very detailed questions about my resume, including some behavioral questions, such as how I recovered from a failed project, a project I'm particularly proud of, and how I handled conflicts

Report Chain ## Problem Overview You are given an org chart as a `list[list[str]]`. Each inner list has the form: ```python [manager, report_1, report_2, ...] ``` For example: ```python [["A", "B",

LeetCode #257: Binary Tree Paths. Difficulty: Easy. Topics: String, Backtracking, Tree, Depth-First Search, Binary Tree. Asked at Capital One in the last 6 months.

LeetCode #510: Inorder Successor in BST II. Difficulty: Medium. Topics: Tree, Binary Search Tree, Binary Tree. Asked at Arista Networks in the last 6 months.

Status: New grad, MS / ME / MTech from IISC / IIT / BITS Pilani. Position: Engineer Location: Hyderabad, India. Date: 29 - 07 - 2020. > This is a On Campus recruitment process,...

Position: Front end Engineer Phone interview. 1. Implement getByClassName() javascript // element.children => HTMLCollection // element.className => string /** * @function getByClassName * @param {Element} root \u2013 The root of the DOM tree * @param {string} className * @return...

I got the file permission question similar to https://leetcode.com/discuss/interview-question/417262/dropbox-phone-screen-permissions-in-a-file-system and the follow-up was to modify implementation so that only the parent has access, for example: A -> B \t ----> C if we have...

File access System I was asked the following question. If given the folder access tree and given query folder name, return TRUE|FALSE is user have access to it. for eg. below -...

LeetCode #1110: Delete Nodes And Return Forest. Difficulty: Medium. Topics: Array, Hash Table, Tree, Depth-First Search, Binary Tree. Asked at Pinterest in the last 6 months.

Let's jump straight to the problem. The following content requires a score higher than 188. You can already view it. It's a variation of the "camera group" problem from the forum. We have a string "or

Problem Overview: Throne Inheritance We need to create a system to manage a family tree for a kingdom. This kingdom starts with a king, and the tree grows as children are born. Every person in this

Problem Statement You have a tree with `n` nodes. The nodes are numbered from `0` to `n - 1`. The tree structure is defined by a list of `edges`, where each item looks like `[parent, child]`. You ar

LeetCode #1257: Smallest Common Region. Difficulty: Medium. Topics: Array, Hash Table, String, Tree, Depth-First Search, Breadth-First Search. Asked at Airbnb in the last 6 months.

Given a XML file, translate the XML file into a tree. We discussed on if it should be a binary tree or n-ary tree. Looking for suggestions from leet code community....

interface CompactTreeBuilder<T> { /** * Given a root of a tree. The tree may be of any depth and width, * i.e. each node may have any number of child...

Given a imbalance binary tree, print the leaf nodes then remove those leaf node, print the new leaf nodes until only root node left. For example: 1 / \\ 2 3 ...

This question was asked recently in the phone interview /** * A tournament tree is a binary tree * where the parent is the minimum of the two children. * Given...

YOE: 6 years Location: Bay area Intro Random/standard Operating System questions: What is page fault, critical section, give real life example for locks. What happens in case of a page fault. Standard silberschatz...

Had my linkedIn Phone interview last week. Got an email from the recruiter to talk about interview feedback. Does the phone call mean reject or moving onto the next round...

Two phone interviews 1 hour each back to back, two leetcode questions. 1 leetcode medium: https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ 1 leetcode easy: https://leetcode.com/problems/maximum-subarray/ Very important to express thoughts as you go through the solution....

Phone Screen- Find the lowest common ancestor of the 2 values in a binary tree. Follow up- return lca only if the 2 values exist in the tree. Question based on Bayes...

This was asked in LinkedIn Interview Given a list of child->parent relationships, build a binary tree out of it. All the element Ids inside the tree are unique. Example: Given the following...

See All 127 Trees Questions

Full question text, interview context, and company-specific frequency data for subscribers.

Get Access

Related Topics