Question d’entretien chez Wipro

Can you explain the difference between a stack and a queue with a real-life example?

Réponse à la question d'entretien

Utilisateur anonyme

20 avr. 2025

I explained that a stack follows the Last In First Out (LIFO) principle, like a stack of plates — the last plate placed is the first one you take. A queue follows the First In First Out (FIFO) rule, like people standing in line at a ticket counter — the first person in line is served first.