# Category Archives: Tree (adsbygoogle = window.adsbygoogle || []).push({});

## Amazon Interview Experience | Set 359 (On-Campus)

20 MCQs mixed with simple Quants, logical, other Technical CS concepts (TOC, DS, DBMS, NETWORKS) 2 Programming questions (I solved both) Maximum Non-Adjacent Subsequence Use… Read More »

## Query for ancestor-descendant relationship in a tree

Given a rooted tree with N vertices and N-1 edges. We will be given many pairs of vertices u and v, we need to tell… Read More »

## Shortest path between two nodes in array like representation of binary tree

Consider a binary tree in which each node has two children except the leaf nodes. If a node is labeled as ‘v’ then its right… Read More »

## Amazon Interview Experience | Set 357 (For 2.5 Years Experienced)

Some time back I went through an interview for Amazon.com for SDE-1 role, and here is my experience to help other aspirants : Written –… Read More »

## Replace each node in binary tree with the sum of its inorder predecessor and successor

Given a binary tree containing n nodes. The problem is to replace each node in the binary tree with the sum of its inorder predecessor… Read More »

## OLA Interview Experience | Set 12

Round 1: Hackerearth online coding round. Round 2: (1 hrs 15 minutes) Left View of a binary tree Explain Binary search and it’s complexity. How… Read More »

## Adobe Interview Experience | Set 47

Round 1(Telephonic) Dynamic memory allocation for 2d array How polymorphism works in C++(Vptr and Vtable implementation) Rope burning puzzle (Measure 45 mins) Round 2(Skype) Find… Read More »

## Largest number in BST which is less than or equal to N

We have a binary search tree and a number N. Our task is to find the greatest number in the binary search tree that is… Read More »

## Print common nodes on path from root (or common ancestors)

Given a binary tree and two nodes, the task is to Print all the nodes that are common for 2 given nodes in a binary… Read More »

## Hike Interview Experience | Set 5

Round I 1.Implement expiry cache system : every page in cache have id and expiry time (TTL of few seconds). After page expires it behaves… Read More »

## Check if an array represents Inorder of Binary Search tree or not

Given an array of N element. The task is to check if it is Inorder traversal of any Binary Search Tree or not. Print “Yes”… Read More »

## Merge Two Binary Trees by doing Node Sum (Recursive and Iterative)

Given two binary trees. We need to merge them into a new binary tree. The merge rule is that if two nodes overlap, then sum… Read More »

## Print the path common to the two paths from the root to the two given nodes

Given a binary tree with distinct nodes(no two nodes have the same have data values). The problem is to print the path common to the… Read More »

## Find mirror of a given node in Binary tree

Given a Binary tree, the problem is to find the mirror of a given node. The mirror of a node is a node which exists… Read More »

## Print path from root to a given node in a binary tree

Given a binary tree with distinct nodes(no two nodes have the same have data values). The problem is to print the path from root to… Read More »