I got reached out by a recruiter on linkedin, I filled the form and got OA link within a week.
OA consisted of 2 medium problems and behavorial questions.
Given a string, we can choose a substring and perform an operation only one time. In the operation we can rotate the substring to right by one position. We have to return the lexicographically smallest string after performing that operation.
Given a string find the minimum number of operations to sort the string by performing the operations.
In one operation we can select a substring (substring can not be the whole string) and sort it.
Status: OA cleared (solved both problems). Also it is required to rightly answer the behavorial question.
After 4 days of O.A. I received the mail that I am selected for the onsite interview.
Interview Pattern
It consisted of 3 rounds , first 2 DSA and last Behavorial/Bar Raiser where they would be asking questions regarding amazon principles.
Both DSA questions were to be done on paper.
Round 1
Q1- Top K frequent elements - was able to give the hashmap + pq approach, but interview wanted more optimal solution, was not able to come up with the bucket sort approach.
Q2- You are given n pipes.
Each pipe has :
Starrting coordinate,
Ending coordinate.
Set of allowed colours with their corresponding capacity(a pipe can allow multiple colours, and each colour for a pipe can have different capacity.)
Water can flow through one pipe to another if and onlny if pipe1.end == pipe2.start
For water of each colour type find.
Maximium number of pipes that water of that colour can flow through.
Maximum total capacity corresponding to the maximum pipe count. (suppose for a route p1->p3->p4, max number of pipes = 3 , max capacity for a colour would be minimum capacity among those 3 pipes for that colour ).
This was a tough one and was not given the data in form of a data stucture. Although I was somehow able to tell the approach.
Status: Better Luck next time.
Compensation Details: