Microsoft interview question

Write code for a stack.