Explain the difference between a stack and a queue. When would you use one over the other?
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: easy
Interview Round: Other
Overview: Asks how a stack differs from a queue and when to choose each one. Tests knowledge of LIFO and FIFO ordering, operation costs, efficient implementations, and matching each structure to problems such as undo, expression parsing, graph traversal and task scheduling.