Coupang Staff Round1

coupang logo
coupang
Staff
October 27, 202544 reads

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)

Q1
Design Data Structure with Min/Max String Counts
Data Structures & AlgorithmsHard

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 1
  • dec(String key) - Decrements the count of the string key by 1
  • getMaxKey() - Returns one of the keys with the maximal count
  • getMinKey() - Returns one of the keys with the minimum count
All functions should show avg O(1) time

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!