← 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

If you push 1, then 2, then 3 onto an empty stack, what does the next pop return?

Answer3

Pop removes the top item, which is the last one pushed: 3.

What does a 'full-stack' developer work on?

AnswerBoth the front end and the back end of an application

Full-stack developers handle the user-facing front end as well as the server-side back end.

Going deeper

Which stack operation looks at the top item without removing it?

AnswerPeek

Peek (sometimes called top) returns the top item while leaving the stack unchanged.

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.

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.

Depth-first search of a graph naturally uses which structure, while breadth-first uses a queue?

AnswerA stack

Depth-first search follows one path as deep as possible, which a stack (or recursion) naturally supports.

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