Skip to main content

Stack & Queue Puzzle

Hit exact pop and dequeue targets using LIFO and FIFO logic. Popping the wrong item teaches you the hard way what order really means.

stack LIFOqueue FIFOoperation planningRead the lesson
How to play
  1. Each round gives a starting structure and a target value to extract.
  2. Stack rounds: use Push (from the input stream) and Pop to make the next pop return the target.
  3. Queue rounds: use Enqueue and Dequeue the same way.
  4. Empty-state mistakes count against accuracy, feedback explains the LIFO/FIFO rule each time.
round1 / 4typestackmistakes0score—

Target state

[23, 72, 31] (bottom → top)

Round 1: STACK. Use Push (consumes the stream left→right) and Pop to make the structure match the TARGET state, then press Check.

Your stack

23
56
76TOP

Input stream (use in order)

7231

Estimated play time: 4–6 min. Scores feed your local progress, stored only in this browser.