Amazon interview question

Implement a deque.