StackAdapt Interview Question

Design a data structure to achieve some operation in linear time