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 →
- How do you evaluate a postfix (reverse Polish) expression?
Scan tokens left to right. Push numbers onto a stack. When you see an operator, pop two numbers, apply the operator (the first popped is the right operand), and push the result. The final stack value is the answer.
BeginnerQuick answerCoding1 min read