Implement Queue using Stacks

Asked at Microsoft · Coding Questions · Difficulty: Easy

Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty).

Loading the problem…