Chapter quiz · Stacks & Queues

Test what you learned.

8 questions on Stacks & Queues. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

Stacks & Queues — Chapter Quiz

Eight questions on stack uses, monotonic stack, queue via two stacks, deque, and circular buffer.

0/ 9
  1. Question 1
    1

    Which problem is a monotonic stack particularly well suited for?

  2. Question 2
    2

    Why is using Array.shift() for a queue in JavaScript problematic?

  3. Question 3
    3

    How does the 'queue via two stacks' technique achieve amortized O(1) enqueue and dequeue?

  4. Question 4
    4

    A deque (double-ended queue) supports:

  5. Question 5
    5

    Which data structure is best for implementing a browser's forward/back navigation history?

  6. Question 6
    6

    A circular buffer (ring buffer) of fixed capacity N can perform both enqueue and dequeue in O(1) time without shifting elements.

  7. Question 7
    7

    In the classic 'valid parentheses' problem, you push opening brackets onto a stack and ___ the top when you see a closing bracket.

  8. Question 8
    8

    Which of the following are valid use-cases for a stack? (Select all that apply)

    Select all that apply.

Pick an answer — instant feedback as you go.