← ChallengesTack.com

Coding · Facts & stats

Stack facts & stats

7 fact-checked facts about stacks in computing, each with the reason behind it. 5 more are in today's round and join this page after it closes.

Play today's round

The basics

What does LIFO, the rule a stack follows, stand for?

AnswerLast In, First Out

In a stack the most recently added item is the first one removed, like a pile of plates.

A queue, unlike a stack, follows which rule?

AnswerFirst In, First Out

A queue serves items in arrival order (FIFO), like people waiting in line.

Going deeper

What commonly causes a 'stack overflow' error?

AnswerRecursion that never reaches a stopping case

Each function call adds a frame to the call stack; endless recursion keeps adding frames until space runs out.

Which task is a classic use of a stack?

AnswerChecking whether brackets are balanced

Push each opening bracket and pop when a closing one appears; a mismatch or leftover means unbalanced.

What is it called when a program tries to pop from an empty stack?

AnswerStack underflow

Underflow means removing from an empty stack; overflow means adding beyond its capacity.

Expert level

Reverse Polish notation expressions like '3 4 +' are typically evaluated using what?

AnswerA stack

Numbers are pushed; each operator pops its operands, computes, and pushes the result back.

For a typical array-based or linked stack, what is the time complexity of push and pop?

AnswerO(1), constant time

Push and pop only touch the top of the stack, so they take constant time regardless of size.

Know these cold?Today's round is five questions like these, 20 seconds each. Your streak and level follow you to every arena.Play today's round