Binary Tree Interview Questions | Practice Problems

 
A Binary Tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child and the topmost node in the tree is called the root. Below is the list of commonly asked interview questions that uses binary tree –

 

  • Check if two given binary trees are identical or not | Iterative & Recursive
     
  • Calculate height of a binary tree | Iterative & Recursive
     
  • Delete given Binary Tree | Iterative & Recursive
     
  • Inorder Tree Traversal | Iterative & Recursive
     
  • Preorder Tree Traversal | Iterative & Recursive
     
  • Postorder Tree Traversal | Iterative & Recursive
     
  • Level Order Traversal of Binary Tree
     
  • Spiral Order Traversal of Binary Tree
     
  • Reverse Level Order Traversal of Binary Tree
     
  • Print all nodes of a given binary tree in specific order
     
  • Print left view of binary tree
     
  • Print Bottom View of Binary Tree
     
  • Print Top View of Binary Tree
     
  • Find next node in same level for given node in a binary tree
     
  • Check if given binary tree is complete binary tree or not
     
  • Determine if given two nodes are cousins of each other
     
  • Print cousins of given node in a binary tree
     
  • In-place convert given binary tree to its sum tree
     
  • Check if given binary tree is a sum tree or not
     
  • Combinations of words formed by replacing given numbers with corresponding alphabets
     
  • Determine if given binary tree is a subtree of another binary tree or not
     
  • Find diameter of a binary tree
     
  • Check if given binary Tree has symmetric structure or not
     
  • Convert binary tree to its mirror
     
  • Check if binary tree can be converted to another by doing any no. of swaps of left & right child
     
  • Find Lowest Common Ancestor (LCA) of two nodes in a binary tree
     
  • Print all paths from root to leaf nodes in given binary tree
     
  • Find ancestors of given node in a Binary Tree
     
  • Find the distance between given pairs of nodes in a binary tree
     
  • Find Vertical Sum in a given Binary Tree
     
  • Print nodes in vertical order of a given Binary Tree (Vertical Traversal)
     
  • Find the diagonal sum of given binary tree
     
  • Print Diagonal Traversal of Binary Tree
     
  • Print corner nodes of every level in binary tree
     
  • In-place convert convert given Binary Tree to Doubly Linked List
     
  • Sink nodes containing zero to the bottom of the binary tree
     
  • Convert given binary tree to full tree by removing half nodes
     
  • Truncate given binary tree to remove nodes which lie on a path having sum less than K
     
  • Find maximum sum root-to-leaf path in a binary tree
     
  • Check if given binary tree is height balanced or not
     
  • Convert normal binary tree to Left-child right-sibling binary tree
     
  • Determine if given Binary Tree is a BST or not
     
  • Convert a Binary Tree to BST by maintaining its original structure
     
  • Invert given Binary Tree | Recursive and Iterative solution
     
  •  
     
    Related Post: Binary Search Tree (BST) Interview Questions




     
     

    Thank you for being with us. 🙂

     




    Leave a Reply

    Notify of
    avatar
    wpDiscuz