Tip 1 : Prepare System Design
Tip 2 : Practice DSA Questions properly
Tip 3 : Practice OOPS and DBMS Concepts
Tip 1 : Your Resume should consist mainly of skills, projects, and achievements. Projects would play a crucial part in your interview and you should have at least one most relevant and good project that shows how strong your concepts are in development.
Tip 2 : The most important tip is that never lie on your resume If you have worked upon some technology for the project part only and don't know the proper depth you could write basics only in your resume.
This round had 2 very basic questions needed to be completed in 60 minutes.I think the criteria as set on if the candidate can identify the edge cases and how quickly he completes the round.



We scan the array from 0 to n-1, keep "promising" elements in the deque. The algorithm is amortized O(n) as each element is put and polled once.
At each i, we keep "promising" elements, which are potentially max number in window [i-(k-1),i] or any subsequent window. This means
If an element in the deque and it is out of i-(k-1), we discard them. We just need to poll from the head, as we are using a deque and elements are ordered as the sequence in the array
Now only those elements within [i-(k-1),i] are in the deque. We then discard elements smaller than a[i] from the tail. This is because if a[x]
As a result elements in the deque are ordered in both sequence in array and their value. At each step the head of the deque is the max element in [i-(k-1),i]



An array c is a subarray of array d if c can be obtained from d by deletion of several elements from the beginning and several elements from the end.
For e.g.- The non-empty subarrays of an array [1,2,3] will be- [1],[2],[3],[1,2],[2,3],[1,2,3].
If arr = {-3,4,5}.
All the possible non-empty contiguous subarrays of “arr” are {-3}, {4}, {5}, {-3,4}, {4,5} and {-3,4,5}.
The product of these subarrays are -3, 4, 5, -12, 20 and -60 respectively.
The maximum product is 20. Hence, the answer is 20.
Can you solve this in linear time and constant space complexity?
Here we use 3 variable called max_so_far, max_ending_here & min_ending_here. For every index the maximum number ending at that index will be the maximum(arr[i], max_ending_here * arr[i], min_ending_here[i]*arr[i]). Similarly the minimum number ending here will be the minimum of these 3
This round was taken by 2 year experienced engineer. He first asked for my intro and quickly jumped onto coding questions. You should know about space and time complexity of your solution else you are in trouble.



1. add(DATA) :
This function should take one argument of type and store it in its pool and returns the 'kth' largest number from the current pool of integers.
val - For this query, insert the integer into your current pool of integers and return the 'kth' largest integer from the existing pool of integers.
1. The maximum number of integers that will be given will always be under memory limits.
2. You will also be given an initial pool of integers whose size equals k.
3. The maximum number of queries will be less than 10^5.
4. The 'kth' largest element is not the 'kth' distinct element but the 'kth' largest element in the sorted order.
5. There will be at least one query of type 2.
Use custom sorting to sort the array in non-decreasing order.
In the custom sort function there will be two cases :
The size of two passed strings is equal, then swap only when string one is lexicographically smaller than the other.
The size of two passed strings is un-equal, then swap only when the size of one string is smaller than the other.
After sorting print Kth largest integer.



• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.

Level 1:
All the nodes in the left subtree of 4 (2, 1, 3) are smaller
than 4, all the nodes in the right subtree of the 4 (5) are
larger than 4.
Level 2 :
For node 2:
All the nodes in the left subtree of 2 (1) are smaller than
2, all the nodes in the right subtree of the 2 (3) are larger than 2.
For node 5:
The left and right subtrees for node 5 are empty.
Level 3:
For node 1:
The left and right subtrees for node 1 are empty.
For node 3:
The left and right subtrees for node 3 are empty.
Because all the nodes follow the property of a binary search tree, the above tree is a binary search tree.
check via in-order traversal [we need to check whether that returned elements are in ascending order]
This round was taken by a lead engineer and was based on system design + coding round.


Input: [[2,1,1],[1,1,0],[0,0,0]]
Output: 2
At T=0, only orange at (0,0) is rotten.
At T=1, oranges at (0,0),(0,1) and (1,0) are rotten.
At T=2, oranges at (0,0),(0,1),(1,0),(0,2) and (1,1) are rotten.
No fresh oranges are left after T=2.
Take a queue Data Structure to do BFS traversal and push the starting {row, col} index of all the rotten oranges.
Declare a count variable to calculate the minimum time to get all oranges rotten and declare it with 0.
Run a while loop until queue becomes empty, calculate the initial size of the queue which will tell the number of oranges which get rotten each level.
Do a BFS traversal by running a loop from 0 to size of queue at each level, check if a fresh orange present at all 4 directions which can be rotted from current orange, if yes push this {row, col} index of that fresh orange to queue and mark this cell as rotten also.
After each level check if queue is not empty means it affected any oranges, then increment the count by 1.
After BFS traversal we again check the grid that it contains any fresh oranges or not if (grid[i][j] == 1), if yes, we return -1, else we return the count as our answer.
HLD for Whatsapp
Tip 1 : Practice a lot of questions to clear this round in this particular company
Tip 2 : Practice previously asked questions.
Tip 3 : Share your thought process with the interviewer.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?