MongoDB Interview Question

Implement a list class that keeps track of a max or min value and implement methods that would efficiently pop those values from the list when invoked.