Went through 4 rounds of interviews.
2 were phone interviews and 2 onsites. The format of the interview was same for both, the phone rounds were conducted in a day, one after the other.
1st interview :
Design a tree which stores characters of string in leaf nodes and the parent of the leaf nodes store the amount of characters in the child node.
Follow up : get characters within [x,y] index
2nd interview :
Print path from one node to another node by printing 'up' or 'left' or 'right' corresponding to the path you're taking.
2
/ \
3 4So the path from 3 -> 4 would be ['up', 'right']
Performed well in both so called in for further rounds
3rd interview:
Find the least price to travel from a node u to node v ( if the path exists) in a weighted undirected graph
Follow up : If each weight signifies the security level of passing from node x to node y, then find the minimum security level you want to travel from node u to node v.
Didn't do so well in this round, was asked for details, competing offers and such but called in for another interview.
4th interview:
consider an array, assign 1 to the smallest number and correspondigly change the array such that the elements have smallest value but maintian the condition : arr[i] > arr[j] then modified arr[i] > arr[j]
All elements are unique
Eg : [4,6,2,8] -> [2,3,1,4]Follow up : Now do this in a 2D array where the condition holds for both rows and columns
Solved this using Topological sorting but took time to reach that solution which is the reason why I think they rejected me. Didn't even think of using graphs actually.
Was asked a behavioural questions in 3 of the interviews and was told by the recruiter that I did well in those but they found gaps in my DSA skills.
Hope to do better next time!