InterviewDB Experience

Token Tree - Parse and Evaluate an Expression Tree from Tokens

Interview Experience

Problem You are given a list of tokens representing a mathematical expression in prefix notation. Build the expression tree and evaluate it. Tokens are either operators (+, -, *, /) or integer literals. Example: Approach Use a recursive descent parser with a pointer into the token list. Each call to parse() consumes one operator and recursively parses its two operands. Follow-ups Extend to handle unary operators (e.g., negation). How would you convert an infix expression to prefix notation first…

Full Details

🔒

Unlock all Sigma Computing questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a candidate experience report from a sigma computing interview during the phone round.

It covers the following topics: Recursion, Coding, Phone .