FAANG phone screen question

You read in a stream of integers and you are required to implement two functions.
get(value) and put(value). put puts the input value into the data structure. get(value) returns the next largest value in the data stream that you have read so far. How would you design this data structure and what would be the complexity of each operation?

Comments (5)