Back to Questions

Implement a Min Stack

101.2K viewsAsked at Apple
Medium

Question Explain

Design a stack that supports push, pop, top, and retrieving the minimum element in $O(1)$ time. This requires using auxiliary storage with the main stack.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question
Implement a Min Stack - Interview Question