Capital One interview question

recreate a stack and implement