Wipro interview question

Explain how stack and queue works with example