Interview Q&A / Data Structures & Algorithms
Data Structures & Algorithms interview questions
Arrays, linked lists, hashing, trees and patterns, with line-by-line code and complexity.
Prefer rapid revision? Practise Data Structures & Algorithms short interview answers →
- What is the difference between a stack and a queue, with real examples?
A stack is last in, first out (LIFO): you add and remove at the same end. A queue is first in, first out (FIFO): you add at the back and remove from the front.
BeginnerQuick answer1 min read