Accenture interview question

Application of Stack & queue