Leetcode 716. Max Stack
Design a stack that supports push, pop, top, peekMax, and popMax (which removes the most recently added maximum element if there are duplicates). The challenge is to maintain fast retrieval and removal of the current maximum even when it isn't at the top, so choose data structures that allow efficient max lookup and deletion.
Asked at:
Confluent
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early September, 2025
Staff
Early August, 2025
Mid-level
Mid March, 2025
Confluent
Staff
Your account is free and you can post anonymously if you choose.