A stack is last-in, first-out. Which item comes off a stack first?

The most recently added item, like the top plate on a pile.

Start playing free

  1. The oldest item
  2. The most recently added item ✔
  3. The smallest item

Why: A stack only lets you add and remove at the top, so the newest item leaves first. A queue is the opposite: first in, first out, like a line at a store.

Huh, didn't know that: Your program's function calls live on a call stack, which is why the last function called is the first to finish.

The dad joke
I told a stack a secret. It came right back out, last in, first out.
Like this card?
Play the game

References

Answer: The most recently added item. A stack only lets you add and remove at the top, so the newest item leaves first. A queue is the opposite: first in, first out, like a line at a store.

  1. Python Tutorial: Data Structures docs.python.org/3/tutorial/datastructures.html
    a stack, where the last element added is the first element retrieved (“last-in, first-out”).
    Checked 2026-10-10.

Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.

Test yourself in the game