Marsh interview question

Asked the implementation of stack.