Tip 1 : Practice problems related to data structures and algorithms
Tip 2 : Brush up fundamental concepts deeply
Tip 3 : You should have a deep knowledge of your projects and related technology.
Tip 1 : It should not be more than a page.
Tip 2 : It should be precise and university projects or prior experience like industrial training or internship should be mentioned.
It was held in the evening around 4 pm. The camera was on during the test to invigilate the activity of students. On any doubtful action, warning was given. Platform was easy to code in.



I made some syntax errors in this one. Be careful.



This was a greedy problem.
1. Sort the array of coins in decreasing order. Initialize result as empty.
2. Find the largest denomination that is smaller than current amount.
3. Add found denomination to result.
4. Subtract value of found denomination from amount.
5. If amount becomes 0, then print result.
6. Else repeat steps 3 and 4 for new value of V.



1. Each array element should belong to exactly one of the subsets.
2. Subsets need not always be contiguous.
For example, for the array : [1, 2, 3], some of the possible divisions are
a) {1,2} and {3}
b) {1,3} and {2}.
3. Subset-sum is the sum of all the elements in that subset.
Input: 'n' = 5, 'arr' = [3, 1, 5, 2, 8].
Ouput: 1
Explanation: We can partition the given array into {3, 1, 5} and {2, 8}.
This will give us the minimum possible absolute difference i.e. (10 - 9 = 1).
The recursive approach is to generate all possible sums from all the values of the array and to check which solution is the most optimal one.
To generate sums we either include the i’th item in set 1 or don’t include, i.e., include in set 2.
More optimized solution is Dynamic Programming.
It was held in the morning around 11:30 am. The interview was scheduled on google meet. The interviewer was quite friendly. He started by a brief introduction. This round was mostly based on Data structures and algorithms. At the end he asked some concepts of OOPs and Operating System.



The input string(STR) will not contain any spaces.
Assume that all characters in STR are lower case letters.
If characters less than 'K' remain, then append them in a sorted way to the new string.
Let the input string be "edcba" with K = 4.
Let the new string to be formed is initially empty, newString = "".
The first set of 4 characters are, ('e', 'd', 'c', 'b')
Out of these 4 characters, the smallest one is 'b' and hence we add it to the newString and it becomes,
newString = "b"
The next set of 4 characters are, ('e', 'd', 'c', 'a')
Out of these 4 characters, the smallest one is 'a' and hence we add it to the newString and it becomes,
newString = "ba"
Now we are left with "edc" and since we can't get a window of size 4, we sort them in the increasing order and append them to the newString.
Hence, newString thus formed will be "bacde".
Solve string questions



1. push(data) :
This function should take one argument of type integer. It pushes the element into the stack and returns nothing.
2. pop() :
It pops the element from the top of the stack and returns nothing.
3. top() :
It returns the element being kept at the top of the stack.
4. getMin() :
It returns the smallest element present in the stack.
Query-1(Denoted by an integer 1): Pushes integer data to the stack. (push function)
Query-2(Denoted by an integer 2): Pops the data kept at the top of the stack. (pop function)
Query-3(Denoted by an integer 3): Fetches and returns the data being kept at the top of the stack. (top function)
Query-4(Denoted by an integer 4): Returns the smallest element present in the stack. (getMin() function)
1. Start from brute force approach by using another stack.
2. Optimise it with reducing push and pop operations.
3. Optimise it to O(1) space complexity.



As the answer can be very large you need to return the answer in mod 10^9+7.
1. I started with brute force approach using three loops.
2. I optimized it to two loops by using sorting and two pointer technique.
What are the conditions for a deadlock to occur?
Tip 1 : Explain what deadlock is briefly.
Tip 2 : Be confident while answering.
Tip 3 : Explain its conditions in detail. Refer to youtube channel gate smashers for clarity of topic.
It was held in the afternoon around 3pm. The interviewer was quite friendly. She started with my introduction. She asked 2-3 problems related to data structures and then asked about python libraries which I used in my projects.



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.
I used hash maps to solve the problems.



If 'N' is 5 and 'K' is 3 and the array is 7, 2, 6, 1, 9
Sorting the array we get 1, 2, 6, 7, 9
Hence the 3rd smallest number is 6.
1. I started with brute force approach of sorting the array and then finding the kth smallest element. This was O(nlogn) approach.
2. Then I solved using heaps with an O(n) approach.
It was held in the evening around 6 pm. The interviewer started with a brief introduction of me. He asked about my projects and then asked some concepts of Operating System and problems related to data structures. I had projects of Machine Learning and Deep learning. Discussion about projects continued for about 25 minutes.


1. If the list is empty, the function immediately returns None because there is no middle node to find.
2. If the list has only one node, then the only node in the list is trivially the middle node, and the function returns that node.
Used hare and tortoise method to solve this problem.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: