Skip to main content

Stacks Quiz

Editorial

16 questions across the five Stacks lessons: the basics, matching brackets, expressions, and monotonic stacks for next greater elements and for ranges. Pick an answer to see whether it's right and why. Nothing is saved, so you can take it again.

If one trips you up, its lesson is Introduction to Stacks, Matching Brackets with a Stack, Evaluating Expressions with Stacks, Monotonic Stack: Next Greater and Smaller Elements or Monotonic Stack: Subarray Minimums and Histograms.

Quiz

1 / 16

Multiple choice

Push 5, push 8, pop, push 1, push 6, pop, pop. In what order do the values come off?