Tip 1 : Prioritise to solve 4-6 problems daily
Tip 2 : Clear your basics, you should know to code stack, queue from scratch
Tip 3 : Give time to solve question by your own before jumping onto the solution
Tip 1 : Should be precise, don’t include everything, keep something to tell them during interview
Tip 2 : Do not put false things
90 minutes round, 3 DSA problems



The width of each bar is the same and is equal to 1.
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].
Output: 10
Explanation: Refer to the image for better comprehension:

You don't need to print anything. It has already been taken care of. Just implement the given function.



Consider N = 5,
All the binary numbers from 1 to 5 are: 1, 10, 11, 100, 101.



Input:
Output: 2 35 2 10 2
Recursive approch



1. A node will be in the bottom-view if it is the bottom-most node at its horizontal distance from the root.
2. The horizontal distance of the root from itself is 0. The horizontal distance of the right child of the root node is 1 and the horizontal distance of the left child of the root node is -1.
3. The horizontal distance of node 'n' from root = horizontal distance of its parent from root + 1, if node 'n' is the right child of its parent.
4. The horizontal distance of node 'n' from root = horizontal distance of its parent from the root - 1, if node 'n' is the left child of its parent.
5. If more than one node is at the same horizontal distance and is the bottom-most node for that horizontal distance, including the one which is more towards the right.
Input: Consider the given Binary Tree:

Output: 4 2 6 3 7
Explanation:
Below is the bottom view of the binary tree.

1 is the root node, so its horizontal distance = 0.
Since 2 lies to the left of 0, its horizontal distance = 0-1= -1
3 lies to the right of 0, its horizontal distance = 0+1 = 1
Similarly, horizontal distance of 4 = Horizontal distance of 2 - 1= -1-1=-2
Horizontal distance of 5 = Horizontal distance of 2 + 1= -1+1 = 0
Horizontal distance of 6 = 1-1 =0
Horizontal distance of 7 = 1+1 = 2
The bottom-most node at a horizontal distance of -2 is 4.
The bottom-most node at a horizontal distance of -1 is 2.
The bottom-most node at a horizontal distance of 0 is 5 and 6. However, 6 is more towards the right, so 6 is included.
The bottom-most node at a horizontal distance of 1 is 3.
The bottom-most node at a horizontal distance of 2 is 7.
Hence, the bottom view would be 4 2 6 3 7



If the given array is: [0, 0, 1, 0, 1] The largest subarray would be: [0, 1, 0, 1] (last 4 elements) having length 4.
Graph - DFS Approach



Input: 'n' = 4,
'accounts' = [
["Rohan", "rohan123@gmail.com", "1279ro@gmail.com"],
["Rohit", "rohit101@yahoo.com", "hitman30487@gmail.com"],
["Rohan", "1279ro@gmail.com", "niemann01@gmail.com"],
["Rohan", "kaushik@outlook.com"],
]
Output: [
["Rohan", "rohan123@gmail.com", "1279ro@gmail.com", "niemann01@gmail.com"],
["Rohit", "rohit101@yahoo.com", "hitman30487@gmail.com"],
["Rohan", "kaushik@outlook.com"],
]
Explanation: The first and third "Rohan" are the same person as they have a shared email address, “1279ro@gmail.com”. The rest of the accounts are of different persons, as they don’t share any shared email addresses. So, we merge the first and third accounts.






Managerial Round - interviewer will have 12-15 years of experience
Tell me about your project in great detail, including its functionality, UI design, project flow, user impact, and your specific contributions.
Any potential delays that may have occurred during the project?
Tell me about a time when I had to make an independent decision without consulting my manager.
Tip 1 : Prepare your projects well
Tip 2 : Align your answer with leadership principle
Tip 3 : Prepare for follow up questions and read about leadership principles

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?