I had Expedia Group Onsite Interview (conducted virtually) for SDE 2 role, Bangalore location. The interview lasted for 1.5 hrs.
Below are the questions -
My answers in the interview -
Puzzle -> Initially i was confused. Then the interviewer told me that all the jars are mislablled. For example
Jar 1 -> Apple
Jar 2 -> Mix of Orange/Apple
Jar 3 -> Orange
So when he says mislablled, it means no way i can say that jar 1 can be apple. According to him, jar 1 can never be apple because it says all are mislabled. Initially the answer i gave was wrong. But the interviewer didnt say that. i asked is that ok, then he said the answer given by me is wrong. So again i gave the answer which was correct but he seemed to be not that impressed.
Solution -> Keep in mind all are mislablled. Jar 2 cannot be mix of orange and apple. Hence take one fruit out of it. Lets say the fruit is orange. Hence jar 2 is definitely orange. Now if jar 2 is orange, that means jar 3 is definitely not orange it can be mix or only apple. Now jar 1 also cannot be only apple as its mislabelled. Hence i can say that jar 3 can be apple and jar 1 can be mix. Hence minimum no of fruits required is 1.
Run a loop for total no of rows. Row wise its sorted and column wise also sorted. Check for every row if the target element is >= first element of row and <= last element of that row. If so, do a binary search on the row elements to find the column index. Return the row and column in string format. If not found, go to next row. Keep doing this for all the rows. After the loop completes, return not found in case there is no element found.
Its a simple leetcode question to find max depth/height of binary tree. I used simple dfs recursion for the solution.
Verdict - Not selected for further rounds.
I dont know the reason why I wasnt selected as i did answer all the questions. Maybe the interviewer didnt like my approach or what I dont know.