Coding Interview Club

Prepare for coding interviews in simple and structured steps

Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2405 of /home/hearti37/public_html/codinginterviewclub/includes/menu.inc).

Problems on Stacks and Queues for Interviews and Self Assessments

Problem: 

Below are some of the problems based on stacks and queues. You will also find applications of stacks and queues in other sections such as Trees and Graphs.

 

Important Points to Remember 

  1. Stack uses the LIFO (Last In First Out) ordering.
  2. Queue uses the FIFO (First In First Out) ordering.

 

Important Points to Revise

  1. Arrays, Linked Lists

 

Problems

  1. Implement a stack
  2. Implement a queue
  3. Add a getMinimum() function to a Stack class of integers.
    • Assumptions and requirements:
      • Stack has push() and pop() method
      • push(), pop() and getMinimum() should operate in O(1)
Solution: 

Refer to individual problems under corresponding problem category for solutions.

Back to Top