Two-Stack FIFO Queue
Asked at Microsoft · Coding Questions · Difficulty: Easy
Build a first-in-first-out (FIFO) queue out of two stacks. The queue must support adding an element at the back, removing and reading the element at the front, and checking whether it is empty, using only the ordinary operations of a stack.
Loading the problem…
More Microsoft interview questions
- LLM conceptual questions
- Roofline Analysis and Mixed-Precision Gradients for Matmul
- Tiny Next-Token Prediction Model (PyTorch Fill-In)
- Design Search Autocomplete / Typeahead
- Design a Chatbot Personalization / Memory System
- Design a Job Scheduler / ETL Pipeline