Diameter of a Binary Tree in O(n) [A new method]
The diameter of a tree is the number of nodes on the longest path between two leaves in the tree. The diagram below shows two… Read More »
The diameter of a tree is the number of nodes on the longest path between two leaves in the tree. The diagram below shows two… Read More »
There were 3 rounds of interviews and cut off percentage was 70%. Round 1 (online on hackerearth) It included 20 MCQ’s and 2 coding questions.… Read More »
Recently OYO Rooms came to our campus to hire full-time for role of software engineer. Round 1: Online Test 20 MCQs on data structures, OS,… Read More »
Round 1: Online Coding Round – 90 min There were 30 MCQ based on data structures and OS. Also, there were two coding questions. First… Read More »
The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two leaves in the tree. The… Read More »
Write a function to connect all the adjacent nodes at the same level in a binary tree. Example: Input Tree A / \ B C… Read More »
There are n houses build in a line, each of which contains some value in it. A thief is going to steal the maximal value… Read More »
First Round: (Written) Maximum sum of non-contiguous elements in array Input : 1 12 5 4 13 Output: 25 Given an array of integers, find… Read More »
Written Test (1 hour and we had to write code on paper): Remove duplicates in sorted linked list You are given an array of non… Read More »
Written Round You have to design url shortening site bit.ly. have to enable history and expiry tracking of url. Design database for your system. Api… Read More »
Wriiten Test One coding question of form minimum cost to travel from 0,0 to N-1,M-1, remaining MCQ for time complexity of running code,other technical questions… Read More »
Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v… Read More »
There is an array of ‘x’ and ‘o’. From each ‘x’ a signal originates which travels in both direction. It takes one unit of time… Read More »
Location: Gurgaon Round 1: Written Test 1. Find number of pairs with sum S in an array Sample input: [3,4,5,6,1,2] 3 Explanation: [{3,4},{6,1},{5,2}] 2. Move… Read More »
There are given n ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal… Read More »