Coupang Staff Round1
Summary
I had my first coding round for a Staff position at Coupang. The interview focused on designing a data structure to manage string counts and efficiently retrieve strings with minimum and maximum counts.
Full Experience
I had my first coding round for a Staff position at Coupang. It was a 1-hour coding question conducted on an online code pairing platform. The interviewer expected an optimal working code. The problem asked me to design a data structure to store the count of strings, with the ability to efficiently return strings with minimum and maximum counts. Specifically, I needed to implement inc(String key), dec(String key), getMaxKey(), and getMinKey(), all targeting an average O(1) time complexity.
Interview Questions (1)
Design a data structure to store the count of strings with the ability to return the strings with minimum and maximum counts.
Implement the class:
inc(String key)- Increments the count of the string key by 1dec(String key)- Decrements the count of the string key by 1getMaxKey()- Returns one of the keys with the maximal countgetMinKey()- Returns one of the keys with the minimum count