Jane Street interview question

Implement custom stack with various operations on it.