Goldman Sachs interview question

Implement a stack and bfs