Which of these is a LIFO (last in, first out) data structure?

- Stack (Answer)
- Queue
- Hash map
- Set
The correct answer is: Stack
A stack works like a pile of plates: you can only add or remove from the top. Your editor’s Undo button uses one, and the famous “stack overflow” error happens when a program’s call stack runs out of room.
More on Wikipedia · From the quiz of Monday, 23 November 2026