Tip 1 : practice coding
Tip 2 : practice explaining your code
Tip 3 : there's no issue with language, you can choose any coding language of yor choice
Tip 1 : Have some projects in your resume that could be impressive
Tip 2 : an internship experience in the resume could be a plus
20 Objective Questions: Aptitude and basic C objective problems.
2 Subjective Questions: both coding



Given a binary tree :

All the root to leaf paths are :
1 2 4
1 2 5
1 3
1. Two nodes may have the same value associated with it.
2. The root node will be fixed and will be provided in the function.
3. Note that the nodes in a path will appear in a fixed order. For example, 1 2 3 is not the same as 2 1 3.
4. Each path should be returned as a string consisting of nodes in order and separated by a space.
5. The path length may be as small as ‘1’.
The idea is to use DFS Traversal to travel from the root to the leaf of the binary tree and calculate the sum of each root to leaf path. Follow the steps below to solve the problem:
1. Start from the root node of the Binary tree with the initial path sum of 0.
2. Add the value of the current node to the path sum.
3. Travel to the left and right child of the current node with the present value of the path sum.
4. Repeat Step 2 and 3 for all the subsequent nodes of the binary tree.
5. On reaching the leaf node, add the path sum to the vector of pathSum.
6. Print all the elements of the vector pathSum as the output.
The interviewer started with a quick introduction and then moved straight to codeing questions, theme was not just to solve the question but to also discuss it with the interviewer, it was a very frank discussion , interviewer was also guiding me at some points. He asked me to solve two coding questions and it took about an hr.



Let the given string be “(()())((”.
Here the valid parentheses substrings are: “()”, “()” and “(()())”. Out of these the longest valid string is “(()())” which has a length 6.
store indexes of previous starting brackets in a stack. The first element of the stack is a special element that provides index before the beginning of valid substring (base for next valid string).



For the given binary tree

The level order traversal will be {1,2,3,4,5,6,7}.
Run a for loop for counter i, i.e. current height from 1 to h (height of the tree).
Use DFS to traverse the tree and maintain height for the current node.
If the Node is NULL then return;
If level is 1 print(tree->data);
Else if the level is greater than 1, then
Recursively call to for tree->left, level-1.
Recursively call to for tree->right, level-1.
This round was similar with the last round , the interviewer started with a quick introduction and then moved straight to codeing questions.



Input:
3
3
4 6 8
3
2 5 7
2
1 9
Output:
1 2 4 5 6 7 8 9
Explanation:
First list is: 4 -> 6 -> 8 -> NULL
Second list is: 2 -> 5 -> 7 -> NULL
Third list is: 1 -> 9 -> NULL
The final list would be: 1 -> 2 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> NULL
pair up K lists and merge each pair in linear time using O(n) space.
After the first cycle, K/2 lists are left each of size 2*N. After the second cycle, K/4 lists are left each of size 4*N and so on.
Repeat the procedure until we have only one list left.
This was an HR + technical round, interviewer asked me questions related to my projects, and intersts, discussed about my experiences in my internship, and one codeing question



1. There will be no leading zeros in any string in the list ‘BINARYNUMS’.
Consider N = 5 and the list ‘binaryNums’= [“0”, “01”, “010”, “100”, “101”]. This list consists of the binary representation of numbers [0, 1, 2, 4, 5]. Clearly, the missing number is 3 and its binary representation will be “11”. So you should return string “11”.
Calculate the sum of the first N natural numbers as sumtotal= N*(N+1)/2.
Traverse the array from start to end.
Find the sum of all the array elements.
Print the missing number as SumTotal – sum of array

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?