Amazon | SDE II | Phone Interview | Reject
Anonymous User
621
May 08, 2024
May 08, 2024
60 minute Interview. First 15-20 minutes were LP questions. Thought I did well.
Coding Question - Implement the following two methods in a class:
recordDeployment(packageName) - increments the frequency count of the package
getTop100Packages() - returns top 100 most frequent used packages from highest to lowest
My initial solution was to use a HashMap and sorting which is O(n log n) which I implemented. Interviewer said can we do better.
Realized it was a heap problem and proposed to use a heap which the interviewer agreed but struggled to implement it correctly with the Map before I ran out of time. Just got word that I failed.
Are there any exisiting LeetCode problems like this? I couldn't find one.
Comments (6)


