Frage im Vorstellungsgespräch bei Flipkart

Coding question: reverse a stack, devise a data structure to do queried in O(1)