Tip 1 : Try to solve some good questions from every topic.
Tip 2 : If not have much time, then you can solve top interview questions from Leetcode.
Tip 3 : Made 2-3 good projects using any technology
Tip 1 : Keep resume short and crispy.
Tip 2 : Add coding profile handles and github link.
It was approx 50 minutes round consist 50 questions, student who was able to did 30 correct answer, qualified for the second round.
Students who qualified in first round gets link for this round, this round had 4 questions in total, out of which 1 was output based and 3 was DSA based.



Let’s say we have n=4 nodes, 'LEFT_CHILD' = {1, -1, 3, -1} and
RIGHT_CHILD = {2, -1, -1, -1}. So the resulting tree will look like this:
It will return True as there is only one valid binary tree and each node has only one parent and there is only one root.
I used level order traversal concept to solve this problem
This round was of 70-75 minutes and had 3 coding questions of easy to medium level. There was some restrictions like we cannot use built-in functions in both second and third subjective round.



Input:
H = 2
Output:
3
There will be a total 3 different balanced binary trees with height 2.
One node as a root and other nodes on one of the two sides.
One with root and left subtree with one more node than right.
One with root and right subtree with one more node than left.
I used postorder tee traversal to solve this problem, first go on left subtree and return the height, similarly gets height of right subtree and check if absolute difference is less than or equal to 1.
This was face to face interview round of 60 minutes. It was mostly based on DSA, some questions was also asked related to my projects and DBMS. Interviewer was kind and good.



If the given sequence ‘ARR’ has ‘N’ elements then the sorted wave array looks like -
‘ARR[0] >= ARR[1]’ and ‘ARR[1] <= ARR[2]’
‘ARR[2] >= ARR[3]’ and ‘ARR[3] <= ARR[4]’
‘ARR[4] >= ARR[5]’ and ‘ARR[5] <= ARR[6]’ And so on.
1. ‘ARR[0]’ must be greater than or equal to ‘ARR[1]’.
2. There can be multiple arrays that look like a wave array but you have to return only one.
3. We have an internal function that will check your solution and return 'True' in case your array is one of the solutions otherwise return 'False'.
The given array ‘ ARR = { 4, 3, 5, 2, 3, 1, 2 } ’
The below figure is a visual representation of the given ‘ARR’ and you can see we can express ‘ARR’ in a waveform array because
4>3 and 3<5
5>2 and 2<3
3>1 and 1<2
And it follows the condition of wave array.

Try to solve this problem in linear time complexity.
Step 1 : I explained her naive approach by sorting the linked list in O(n.log(n)) TC.,
Step 2 : interviewer asked me to optimise it.
Step 3 : After thinking sometime I told her the solution in O(n) TC, this time she seems to be happy and asked me to write the code.



1) If the left subtree exists it should contain only nodes with values less than the current node's value.
2) If the right subtree exists it should contain only nodes with values greater than the current node's value.
3) Both the left and right subtrees should also be Binary Search Tree.

For the above binary tree, the BST with the maximum possible sum is marked with RED colour, the sum of this BST is equal to 6.
Step 1 : I break this problem into two parts, whether the subtree is BST or not and sum of subtree and then told the approach to the interviewer, I was using some space to store values like sum of subtree, but interviewer denied for this and asked me to optimise, then I optimise it.
This was the final technical round, it was around 2.5 hours long and based on mostly DSA and little bit Projects, DBMS, OS. Josh mainly focus on DSA and on Tree Data Structure in interview.



• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.
1. All the elements of the Binary Search Tree are unique.
2. You can’t use the same node value/element of BST twice.
tree: 8 5 10 2 6 -1 -1 -1 -1 -1 7 -1 -1
'K' = 13,

The nodes with values 8 and 5 as shown in the above figure gives sum equal to the given target 13.
Therefore, the output will be “true” i.e it is possible to find a pair in the given BST having sum equal to ‘K’.
Step 1 : Earlier, this question seems to be very easy, I told the approach using O(n) TC and O(n) SC, then interviewer asked me to optimise the SC.
Step 2 : I told the another approach using O(n(logn)) TC and O(1) SC, but again interviewer was not happy and this time she asked me to optimise TC.
Step 3 : After lot of thinking, I cam up with the solution using Stack DS, that takes O(n) TC and O(heigh_of_tree) SC, this was the approach interviewer was looking for, he asked me to write the code



1. A binary tree is a tree in which each node has at most two children.
2. The given tree will be non-empty.
3. The given tree can have multiple nodes with the same value.
4. If there are no nodes in the tree which are at distance = K from the given node, return an empty list.
5. You can return the list of values of valid nodes in any order. For example if the valid nodes have values 1,2,3, then you can return {1,2,3} or {3,1,2} etc.

Consider this tree above. The target node is 5 and K = 3. The nodes at distance 1 from node 5 are {2}, nodes at distance 2 from node 5 are {1, 4} and nodes at distance 3 from node 5 are {6, 3}.
Step 1 : Firstly, I gave BFS solution, first find the parent of every node of tree and then push pair of target_node, distance(k) in the queue, run the loop till queue is not empty and each time pop the top pair from queue and check if pair.second(distance) is 0 then add pair.first(node) in answer vector otherwise push pair.first right, left and parent(if exists), dis-1 in the queue.
Step 2 : Interviewer asked me to optimise the SC.
Step 3 : I told the approach using DFS in constant space, this time interviewer asked me to write the code.
This was the simple 20 minutes round
In this interviewer asked me about my family, residence and if I will have any issue in relocating to Gurgaon. After 30 minutes of this round they send me mail regarding my selection.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?