StackAdapt interview question

Design a data structure to achieve some operation in linear time