Position: SDE2
Behavioral Question: Scenario with tight deadline.
Technical Question: If you are given a list of kindle ids with most opened cound for each, find the k most opened books.
Solution
I gave 2 solutions first sorting and then return k list, second solution max heap. IInterviewer asked me to implement the heap solution. I implemented and finished the solution. I told the time and space complexity for both solutions. Interviewer asked if there is any other possible solution which is better than both of these solutions which uses no extra space and time is less than O(nlogn)