Amazon Interview Question

Implementing queue with stack and vice versa