Optiver interview question

2 OOPs based question one was on queue and other on stacks