Tesla interview question

Implement a queue with min max