Tip 1 : Practice DSA questions regularly from coding platforms.
Tip 2 : Have a clear understanding of the OS, DBMS and OOPS concepts.
Tip 3 : Be proficient in one programming language.
Tip 1 : Resume should be of 1-page only.
Tip 2 : Focus more on sections like Work Experience, Projects etc.
This was the first round. The interviewer discussed two coding problems with me.



You may assume that given ‘X’ and ‘Y’ definitely exist in the given binary tree.
For the given binary tree

LCA of ‘X’ and ‘Y’ is highlighted in yellow colour.
I explained the recursive approach of traversing the tree in a depth-first manner to him. The moment you encounter either of the nodes node1 or node2, return the node. The least common ancestor would then be the node for which both the subtree recursions return a non-NULL node. It can also be the node which itself is one of node1 or node2 and for which one of the subtree recursions returns that particular node.
Pseudo code :
LowestCommonAncestor(root, node1, node2) {
if(not root)
return NULL
if (root == node1 or root == node2)
return root
left = LowestCommonAncestor(root.left, node1, node2)
right = LowestCommonAncestor(root.right, node1, node2)
if(not left)
return right
else if(not right)
return left
else
return root
}



Input: 'a' = [2, 4, 6] and 'b' = [1, 3, 5]
Output: 3.5
Explanation: The array after merging 'a' and 'b' will be { 1, 2, 3, 4, 5, 6 }. Here two medians are 3 and 4. So the median will be the average of 3 and 4, which is 3.5.
1. I explained the linear approach to him first - Merging the sorted arrays and then finding the median element.
Time Complexity : O(m + n)
2. Later, I explained the binary search approach to him. He asked me to code it and do a dry run on one example.
This was the second round. We started with a brief introduction. The interviewer then asked one coding problem and we had a long discussion on that problem only.




If S = “34”, then all the possible letters that can be formed from string S are {“dg”, “dh”, “di”, “eg”, “eh”, “ei”, “fg”, “fh”, “fi”}.
Map the number with its string of probable alphabets, i.e 2 with “abc”, 3 with “def” etc.
Create a recursive function which takes the following parameters, output string, number array, current index, and length of number array
If the current index is equal to the length of the number array then print the output string.
Extract the string at digit[current_index] from the Map, where the digit is the input number array.
Run a loop to traverse the string from start to end
For every index again call the recursive function with the output string concatenated with the ith character of the string and the current_index + 1.
This was a typical managerial round. We started with a brief introduction. Then, the interviewer moved to my projects and started asking questions on one of the projects that he found interesting. At last, he asked me some questions based on Operating Systems.
1. Difference between process and thread. Give example.
2. Difference between Internal and External Paging
3. What is virtual memory?
Tip 1 : Revise all OS concepts from Galvin.
Tip 2 : Have a clear understanding of the concepts as real-life based examples can also be asked.

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?