Back to Questions

Implement a Queue using Stacks

26.2K viewsAsked at Uber
Easy

Question Explain

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`).

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question