Bloomberg interview question

How to implement max stack