Tip 1 : Practice at least 200 Questions(Mostly from trees and linked list)
Tip 2 : Try to dry run every problem you practice
Tip 1 : Do not puts false things on resume
Tip 2 : Its good to have some projects
This Round consists of 50 MCQs questions Out of Which 40 were related to basic programming questions and 10 were related to aptitude. some questions were output bases. Also, there was negative marking too.
Number Of MCQs - 50
This Round consists of 2 coding Questions.



I solved This problem using sliding Window Technique



Below is the example showing the input tree and its sum tree.

I solved it using preorder traversal.
This Round consists of 3 Coding Problems of Medium Difficulty




i solves it using recusion



Given linked list: ‘2 => 1 => 3 => 4 => 6 => 5’
While maintaining the relative order of nodes as it is in the input, Nodes at odd positions are (2, 3, 6), and nodes at evens position are (1, 4, 5).
Modified linked list: ‘2 => 3 => 6 => 1 => 4 => 5’
1. Consider that the first node is odd, the second is even, and so on.
I solved it by finding integral square root of every Node.



1)The amount of petrol that is available at this particular petrol pump.
2)The distance to reach the next petrol pump.
I solved it using greedy algorithm
This round started at 9 AM. The interviewer asked me about my introduction and about my projects. the interviewer was really polite.



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.
if an even index node is less than previous node then it with previous node and if an odd index node is greater than previous node then swap it with previous node.



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.
I solved it using post order traversal and making a class to return various answers such as curr_sum, maxSum, isBst etc



if root node is less than low then return right subtree and if root node is greater than max then return left subtree
This round started at 12 PM. The interviewer asked me about my introduction and about my projects. the interviewer was really polite.



A binary search tree, also called an ordered or sorted binary tree, is a rooted binary tree whose internal nodes each store a key greater than all the keys in the node's left subtree and less than those in its right subtree.
A balanced binary search tree is a tree in which each node has either 0 or 2 children.
For Example, the root node is given as follows :
‘ROOT’ = 5 2 6 -1 -1 -1 -1 and ‘target’ = 8, The answer will be true since the sum of both leaf nodes is equal to 8.
I first tried to convert the tree to Doubly Linked List but the interviewer asked me to do it without conversion. then create a function to traverse the tree in inorder and reverse inorder traversal and then the interviewer was satisfied with this approach.



If N = 4, K = 2 and subjects = {50,100,300,400}
Assignment of problems can be done in the following ways among the two friends.
{} and {50,100,300,400}. Time required = max(0, 50+100+300+400) = max(0, 850) = 850
{50} and {100,300,400}. Time required = max(50, 100+300+400) = max(50, 800) = 800
{50, 100} and {300,400}. Time required = max(50+100, 300+400) = max(150, 700) = 700
{50,100,300} and {400}. Time required = max(50+100+300, 400) = max(450, 400) = 400
{50,100,300, 400} and {}. Time required = max(50+100+300+400, 0) = max(850, 0) = 850
So, out of all the above following ways, 400 is the lowest possible time.
I solved it using Binary Search.
This round was a Discussion Round.
How was your Day?
Tell me about Yourself.
2 strengths and weaknesses.
How many members in your family?
Can you work form office?

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?