Tip 1: Prepare DSA thoroughly, and I personally recommend Coding Ninjas for interview preparation.
Tip 2: Be confident and relaxed during the interview.
Tip 3: Revise your projects, including how they work and what their functionalities are.
Tip 1: Keep your resume concise, ideally one page, and mention only the skills you are confident in.
Tip 2: Do not include false information on your resume.
There were 3 coding questions, and I solved all of them. They were based on arrays, trees, and linked lists.
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.
By using ODD, EVEN pointers.
by using sliding window.
If we are given the above binary tree as input then moving from root node(5) to the farthest leaf node(50), the path formed will be [ 5->10->25->35->40->45->50 ]. The total number of nodes encountered is 7, therefore the maximum depth of the binary tree is 7.
Using BFS, I was able to solve this problem.
The interviewer asked some OOPS concepts and tree-related questions.
For the given binary tree: [1, 2, 3, -1, -1, 4, 5, -1, -1, -1, -1]
Start Node: 3
1
/ \
2 3
/ \
4 5
Output: 2
Explanation :
In the zeroth minute, Node 3 will start to burn.
After one minute, Nodes (1, 4, 5) that are adjacent to 3 will burn completely.
After two minutes, the only remaining Node 2 will be burnt and there will be no nodes remaining in the binary tree.
So, the whole tree will burn in 2 minutes.
Not able to solve
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which SQL keyword removes duplicate records from a result set?