Tip 1 : Practice Leet Code easy medium problems regularly and once you solve the question, read discussion tab to see other's solution.
Tip 2 : Do atleast 2 projects on different demanding technologies like ML or Android or web.
Tip 3 : Don't skip important topics like DBMS, OOPS and operating systems. They are equally important
Tip 1 : Be real and true with your resume.
Tip 2 : Have a diverse resume with different Projects and courses and open-source contribution mentioned in it.
There were total of 2 DSA problems to be solved in 1 hr. One of them was a debugging question that I don't exactly remember. Full screen mode was there with web cam on and you cannot open any other tab.



1. Store the frequency for each character in the given string s in a frequency array called frequency.
2. We store the frequency for a character c at index c - 'a'. Thus, we will need 26 indices (from 0 to 25) to store the frequencies of the characters.
3. Store the frequencies in the max heap pq. Only insert non-zero frequencies into the priority queue.
4. While the priority queue pq has more than one element:
a. Store the top element in the variable topElement and pop it.
b. If topElement and the new top element in pq are the same, decrement the value topElement and
increment deleteCount. If topElement is still greater than zero, then push it back into pq.
5. Return deleteCount.




1. Traverse the given array and pick each element one by one.
2. Fill each of this element in the spiral matrix order.
3. Spiral matrix order is maintained with the help of 4 loops – left, right, top, and bottom.
4. Each loop prints its corresponding row/column in the spiral matrix.



he approach is pretty simple. We will use 0 as a pivot element and whenever we see a non zero element we will swap it with the pivot element. So all the non zero element will come at the beginning.
Design google calendar.
Tip 1 : first gather all the basic requirements from the interviewer
Tip 2 : try to find 1 or 2 additional use case you can think.
Tip 3 : Stick to basics and talk with interviewer at every point



Elements are in the level order form. The input consists of values of nodes separated by a single space in a single line. In case a node is null, we take -1 in its place.
For example, the input for the tree depicted in the below image would be :

1
2 3
4 -1 5 6
-1 7 -1 -1 -1 -1
-1 -1
Explanation :
Level 1 :
The root node of the tree is 1
Level 2 :
Left child of 1 = 2
Right child of 1 = 3
Level 3 :
Left child of 2 = 4
Right child of 2 = null (-1)
Left child of 3 = 5
Right child of 3 = 6
Level 4 :
Left child of 4 = null (-1)
Right child of 4 = 7
Left child of 5 = null (-1)
Right child of 5 = null (-1)
Left child of 6 = null (-1)
Right child of 6 = null (-1)
Level 5 :
Left child of 7 = null (-1)
Right child of 7 = null (-1)
The first not-null node (of the previous level) is treated as the parent of the first two nodes of the current level.
The second not-null node (of the previous level) is treated as the parent node for the next two nodes of the current level and so on.
The input ends when all nodes at the last level are null (-1).
The above format was just to provide clarity on how the input is formed for a given tree.
The sequence will be put together in a single line separated by a single space. Hence, for the above-depicted tree, the input will be given as:
1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1
Record the maximum value along the path from the root to the node.
Time O(N)
Space O(height)



Input: Let the binary tree be:

Output: [10, 4, 2, 1, 3, 6]
Explanation: Consider the vertical lines in the figure. The top view contains the topmost node from each vertical line.
we need to put nodes of same horizontal distance together. We do a level order traversal so that the topmost node at a horizontal node is visited before any other node of same horizontal distance below it. Hashing is used to check if a node at given horizontal distance is seen or not.
Managerial Round
Design a keyword search engine
Tip 1 : Basically, a use case of Trie data structure

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?