Tip 1 : Do a very good amount of DSA questions & make sure to revise them after a period of time which you were unable to solve
Tip 2 : Topics like DBMS, OOPs are asked in many interviews of companies, so make sure you don't ignore them
Tip 3 : Projects play an important role in your selection, so make sure you know about the technology and have decent knowledge about the project
Tip 1 : Resume must be of 1 page only
Tip 2 : All your projects & achievements must be short & brief
This round started near 1 pm and was like any other normal test.



Input: 'arr' = [2, 2, 2, 2, 0, 0, 1, 0]
Output: Final 'arr' = [0, 0, 0, 1, 2, 2, 2, 2]
Explanation: The array is sorted in increasing order.
Step 1 : I knew this question is to be solved using Dutch National Flag algorithm.
Step 2 : Declared 3 variables, low = 1, mid = 1, high = N
Step 3 : I traversed the array from start to end till mid is less than high
Step 4 : If current number at index i is 0, swap this number with element at low and increase both(low++, mid++)
Step 5 : If current number at index i 1, simply do mid++
Step 6 : If current number at index i is 2, swap this number with element at high and decrease both(high--, i--)
Step 7 : Return the updated array



Step 1 : Created deque and added first k element in it. But while adding we check if last element in deque is less than current element to be added, we remove that last element. We do this for all the elements left in deque and add current element only if elements at last of deque are greater
Step 2 : Now run loop for remaining elements, firstly we print the first element of deque as it is our required answer for first window. Step 3 & 4 comes under for loop
Step 3 : Then we remove the element from front of queue if they are out of the current window.
Step 4 : Ans now before adding the current element we check same condition as done in step 1 before adding
Step 5 : At last we print the first element of deque as it is answer for the last window.
The time for this round was around 12 noon.
Tip 1 : I referred online platforms and tutorials for my preparation
Tip 2 : I tried to cover all interview questions for these topics and it helped me a lot
Tip 3 : Practice such questions as they are usually asked in many interviews



The order in which the groups and members of the groups are printed does not matter.
inputStr = {"eat","tea","tan","ate","nat","bat"}
Here {“tea”, “ate”,” eat”} and {“nat”, “tan”} are grouped as anagrams. Since there is no such string in “inputStr” which can be an anagram of “bat”, thus, “bat” will be the only member in its group.
Step 1 : Since a array of strings is given, traverse this array and get each string.
Step 2 : Firstly I convert this string to char array and then sort the characters and again convert it to a string
Step 3 : Now check in map if this exists. If not, create a list and add as value in map.
Step 4 : Else, get the list, add current string & update map
Step 5 : Finally create 2d list and add all values of map to it & return



Input: 'arr' = [1, 2, 1, 2, 1]
Output: 3
Explanation: The longest bitonic subsequence for this array will be [1, 2, 1]. Please note that [1, 2, 2, 1] is not a valid bitonic subsequence, because the consecutive 2's are neither strictly increasing, nor strictly decreasing.
Step 1 : Firstly we find the bitonic element using binary search. We check mid, if it is greater than it's adjacent it is bitonic.
Step 2 : If mid element is greater than its next element and smaller than the previous element then maximum lies on left side of mid
Step 3 : If mid element is smaller than its next element and greater than the previous element then maximum lies on right side of mid
Step 4 : Now since we have bitonic element, we compare element to be searched with this
Step 5 : If it is greater, then it does not exist. If it is equal to it, we return this
Step 6 : If the element to be searched is less than the element at a bitonic point then search for the element in both halves of the array using binary search
The interviewer was very cool and supportive in this interview. This interview held after 3 hours of completion of my second round



1. K is a non-negative integer.
2. Absolute Difference between two integers A and B is equal to the difference of maximumOf(A, B) and minimumOf(A, B).
3. Pair of integers should have different indices in the array.
Step 1 : Set count as 0 & add all distinct elements in a hashmap
Step 2 : Traverse the given array
Step 3 : If a[i]+k is present in hashmap, increase count
Step 4 : If a[i]-k is present in hashmap, increase count
Step 5 : Remove a[i] from hashmap
Step 6 : Return count



‘N’ = 3, ‘coins’ = {1, 2, 3}, ‘freq’ = {1, 1, 3}, ‘V’ = 6
For the given example, we can make six by using the following coins:
{1, 2, 3}
{3. 3}
Hence, the answer is 2.
Step 1 : First creating the base dp array, with first value set to 0
Step 2 : Then sorting the given coins
Step 3 : Traversing till amount to fill the dp array
Step 4 : Set dp[i]=INT_MAX
Step 5 : Traverse all the coins available, if it's greater than i(current amount) then break
Step 6 : Then set if (dp[i - c] != INT_MAX) dp[i] = min(dp[i], 1 + dp[i - c]);
Here we actually check the value of i-c, that is value of dp array after removing the value of current coin, if it is a valid value, we update dp[i] to min of dp[i] & 1+dp[i - c].
Step 7 : Finally we return -1 if dp[n]=INT_MAX else its value
The round was held around 1pm and the interviewer was very friendly
Tip 1 : Tell about it in brief and focus on academics
Tip 2 : Make sure you research a bit about the company before giving this round
Tip 3 : These matters, so be honest about them

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?