Amazon interview question

Implementing queue with stack and vice versa