XM Cyber interview question

Implement a stack data structure.