← Amazon questions

Find minimum element in stack in O(1) time

Filed under Amazon

Design a stack that supports standard operations (push, pop, top) and a getMin() operation that retrieves the minimum element in the stack in O(1) time. Optimize the implementation to use as little…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.