Morgan Stanley interview question

implement a stack