Tesla Interview Question

Implement a queue with min max