Flexport interview question

Question involving performing operations on a stack