Medium | GCDs of given index ranges in an array | Problem Statement The problem ‘GCDs of given index ranges in an array” states that you read more |

Easy | Find Maximum Level sum in Binary Tree | Problem Statement The problem “Find Maximum Level sum in Binary Tree” states that you read more |

Easy | Red-Black Tree Introduction | Red Black Tree is a self-balancing binary tree. In this tree, every node is either a red node or a read more |

Medium | Binary Search Tree Delete Operation | Problem Statement The problem “Binary Search Tree Delete Operation” asks us to read more |

Easy | Iterative Method to find Height of Binary Tree | Problem Statement The problem “Iterative Method to find Height of Binary Tree” states read more |

Medium | Clone a Binary Tree with Random Pointers | Problem Statement You are given a complete binary tree with some random pointers. Random pointers read more |

Easy | Check if all levels of two Binary Tree are anagrams or not | Problem Statement The problem “Check if all levels of two Binary Tree are anagrams or read more |

Easy | An Interesting Method to generate Binary Numbers from 1 to n | Problem Statement The problem “An Interesting Method to generate Binary Numbers from 1 to read more |

Easy | Check if the given array can represent Level Order Traversal of Binary Search Tree | Problem Statement The problem “Check if the given array can represent Level Order Traversal read more |

Easy | Number of siblings of a given Node in n-ary Tree | Problem Statement The problem “Number of siblings of a given Node in n-ary Tree” states read more |

Easy | Check whether a given Binary Tree is Complete or not | Problem Statement The problem “Check whether a given Binary Tree is Complete or not” read more |

Easy | Count the number of nodes at given level in a tree using BFS | Description The problem “Count the number of nodes at given level in a tree using BFS” read more |

Easy | Minimum number of distinct elements after removing m items | Problem Statement The problem “Minimum number of distinct elements after removing m read more |

Medium | Convert BST into a Min-Heap without using array | Problem Statement “Convert BST into a Min-Heap without using array” problem states that read more |

Medium | Merge two BSTs with limited extra space | Problem Statement The problem “Merge two BSTs with limited extra space” states that you read more |

Easy | Binary Tree to Binary Search Tree Conversion using STL set | Problem Statement We are given a binary tree and we need to convert it into a binary search tree. read more |

Medium | K’th Largest element in BST using constant extra space | Problem Statement “K’th Largest element in BST using constant extra space” states read more |

Easy | K’th Largest Element in BST when modification to BST is not allowed | Problem Statement “K’th Largest Element in BST when modification to BST is not read more |

Easy | Check if each internal node of a BST has exactly one child | Problem Statement “Check if each internal node of a BST has exactly one child” problem states read more |

Easy | Height of a generic tree from parent array | Problem Statement “Height of a generic tree from parent array” problem states that you read more |

Easy | Find k-th smallest element in BST (Order Statistics in BST) | Problem Statement “Find k-th smallest element in BST (Order Statistics in BST)” problem read more |

Easy | Vertical sum in a given binary tree | Problem Statement “Vertical sum in a given binary tree” problem states that you are given a read more |

Easy | A program to check if a binary tree is BST or not | Problem Statement “A program to check if a binary tree is BST or not” states that you are given read more |

Easy | Check for Identical BSTs without building the trees | Problem Statement “Check for identical BSTs without building the trees” problem states that you read more |

Easy | Maximum Depth Of Binary Tree | Problem Statement “Maximum depth of binary tree” problem states that you are given a read more |

Easy | Convert BST to Min Heap | Problem Statement Given a complete Binary Search Tree, write an algorithm to convert it into a Min read more |

Medium | Merge Two Balanced Binary Search Trees | Problem Statement Given Two Balanced Binary Search Trees, there are n elements in the first BST and read more |

Easy | Binary Search Tree Search and Insertion | Problem Statement Write an algorithm to perform searching and insertion in Binary Search Tree. So read more |

Easy | Convert a normal BST to Balanced BST | Problem Statement Given a Binary Search Tree(BST), write an algorithm to convert the BST to a read more |

Medium | Check given array of size n can represent BST of n levels or not | Problem Statement Given an array with n elements, check given array of size n can represent BST of read more |

Medium | Binary Tree to Binary Search Tree Conversion | In binary tree to binary search tree conversion problem, we have given a binary tree convert it to read more |

Sorted Linked List to Balanced BST | In sorted linked list to balanced BST problem, we have given a singly Linked list in sorted order, read more | |

Sorted Array to Balanced BST | In sorted array to balanced BST problem, we have given an array in sorted order, construct a read more | |

Transform a BST to Greater sum Tree | In transform a BST to greater sum tree Given a Binary Search Tree write an algorithm to convert it read more | |

Convert a BST to a Binary Tree such that sum of all greater keys is added to every key | Given a Binary Search Tree, write an algorithm to Convert a BST to a Binary Tree such that the sum read more | |

Advantages of BST over Hash Table | The most commonly used operations on any data structure are insertion, deletion, and searching. read more | |

Construct BST from its given Level Order Traversal | Given the level order traversal of a Binary Search Tree, write an algorithm to construct the Binary read more | |

Construct BST from given Preorder Traversal | Given a pre-order traversal of a Binary Search Tree(BST), write an algorithm to construct the BST read more | |

BST to a Tree with Sum of all Smaller Keys | In this problem we have given a Binary Search Tree, write an algorithm to convert best to a tree read more | |

Find the node with minimum value in a Binary Search Tree | Given a Binary Search Tree, write an algorithm to find the node with the minimum value in a given read more | |

Construct Binary Tree from Given Inorder and Preorder Traversals | In this problem, we have inorder and preorder of the binary tree. We need to construct a binary read more | |

Reverse a Path in BST using Queue | In reverse a path in BST using queue problem we have given a Binary Search Tree and node, write an read more | |

Print Ancestors of a Given Binary Tree Node Without Recursion | Given a binary tree and a specific node or key. Print ancestors of a given binary tree node without read more | |

Level order Traversal in Spiral Form | In this problem we have given a binary tree, print its level order traversal in a spiral form. read more | |

Kth Smallest Element in a BST | In this problem, we have given a BST and a number k, find the kth smallest element in a BST. read more | |

Balanced Binary Tree | In the balanced binary tree problem, we have given the root of a binary tree. We have to determine read more | |

Interval Tree | In the interval tree problem, we have given a set of intervals and three types of queries read more | |

Construct Complete Binary Tree from its Linked List Representation | Given the linked list representation of a complete binary tree. The linked list is in the order of read more | |

Lowest Common Ancestor | Given the root of a binary tree and two nodes n1 and n2, find the LCA(Lowest Common Ancestor) of read more | |

Averages of Levels in Binary Tree | In averages of levels in binary tree problem we have given a binary tree, print the averages of all read more | |

Lowest Common Ancestor in Binary Search Tree | Given the root of a binary search tree and two nodes n1 and n2, find the LCA(Lowest Common read more | |

Segment Tree | If we have performing addition on a given range of array whose element values updated any time. read more | |

Print a Binary Tree in Vertical Order | In this problem, we have given a pointer denoting the root of the binary tree and your task is to read more | |

Binary Search Tree | A binary search tree is a Binary tree with some rules that allows us to maintain the data in a read more | |

Maximum Binary Tree | In this problem, we have given an array a[ ] of size n. Create the maximum binary tree from the read more | |

Binary Tree zigzag level order Traversal | Given a binary tree, print the zigzag level order traversal of its node values. (ie, from left to read more | |

Recover Binary Search Tree | Consider a binary search tree, two nodes of the tree have been swapped, design an algorithm to read more | |

Populating Next Right Pointers in Each Node | Given a Binary Tree, connect nodes that are at the same level from left to right. Structure of the read more | |

Top View of Binary Tree | The top view of a binary tree is the set of nodes visible when the tree is viewed from the top. read more | |

Level of Each node in a Tree from source node | Given a tree (an acyclic fully connected graph where constituent nodes are connected by read more | |

Find Duplicate Subtrees | Duplicate Subtrees Subtrees are said to be duplicate if they have the same node values and read more | |

Symmetric Tree | In Symmetric Tree problem we have given a binary tree, check whether it is a mirror of itself. A read more | |

Minimum Height Trees | In the Minimum Height Trees problem, we have given an undirected graph which is tree in nature read more | |

Trim a Binary Search Tree | In Trim a Binary Search Tree problem we have given a binary search tree and a lower (as L) and read more | |

Convert Sorted List to Binary Search Tree | Problem Given a linked list. The elements of the linked list are in increasing order. Convert the read more | |

Validate Binary Search Tree | Problem In Validate Binary Search Tree problem we have given the root of a tree, we have to check read more | |

Path Sum | What is Path Sum Problem? In the Path Sum problem, we have given a binary tree and an integer SUM. read more | |

Level Order Traversal of Binary Tree | Level Order Traversal of a given binary tree is the same as the BFS of the binary tree. Do we read more | |

Tree Traversal (Preorder, Inorder & Postorder) | First, we need to know about what is Traversal in Binary Tree. Traversal is a type of method in read more | |

Deletion in a Binary Tree | Do we already know about what actually Binary Tree is? Now in this post, we are focusing on how to read more | |

Unique Binary Search Trees | Firstly we have to find the total number of counts to form a unique binary search tree. After it, read more | |

Decision Tree | Decision Tree is a decision support tool that helps us for finding the best result. It’s used read more | |

Verify Preorder Serialization of a Binary Tree | First, we need to know what actually Preorder of a Binary Tree is. Preorder is a type of Binary read more | |

Binary Tree Data Structure | In this article, we will read about the Binary Tree Data Structure. Trees are hierarchical data read more | |

Types of Binary Tree | Before we proceed, we first know what BT really is? Binary Tree is a type of data structure that is read more | |

Insertion in a Binary Tree | In this article, we will learn the insertion in a binary tree. We have already seen the concept of read more | |

Serialize and Deserialize Binary Tree | We have given a binary tree containing N number of nodes where each node has some value. We need to read more | |

Delete a Tree | Time Complexity : O(n) Space Complexity :O(1) Here we use, Post-Order traversal method to delete read more | |

Binary Tree | Binary Tree is fundamental data structure, where we can easily store and retrieve data. It is made read more | |

Searching a node in a Binary Search Tree | Searching a data value in a Binary Search Tree. It says whether the data value is present or not in read more | |

Binary Tree Level order traversal in Java | Level order traversal or breadth first traversal is traversing the same level nodes of a tree then read more | |

Java program to find the number of Nodes in a Binary Tree | Total number of nodes in a binary tree is known as a size of a tree. We have to write a program in read more |

# Tree Interview Questions

I am presenting a collection of commonly asked tree interview questions. Tree questions are the mostly asked questions these days. Interviewer wants to know, how efficient code you can write. Therefore practice technical questions on trees.

Tree questions can be solved using recursion, queue, stack. After practicing the questions your brain will start working automatically which approach should be used to solve the specific interview question

These tree practice questions will help you clearing the difficult programming rounds. In other words, these rounds will be based on tree questions. But, you should practice tree questions frequently. For example, you can practice one or two questions daily.

I know tree questions are tricky and takes time, but practice will make you perfect.

Below are the tree practice questions which you should start practicing. Tree questions should be solved without seeing the solution. After that you can match how we have solved the tree questions.

Tree algorithm questions should help you to clear interview rounds of product based companies.

Below are the practice questions on tree