Loading section...
Stack-Based Expression Evaluation
Concepts: pyExpressionEval, pyShuntingYard, pyRPN
Evaluating arithmetic expressions with correct operator precedence is a classic stack problem that appears in DE interviews framed as 'parse a filter expression' or 'evaluate a query condition.' The algorithm is Dijkstra's shunting-yard algorithm. It uses two stacks: one for operands (numbers), one for operators (+, -, *, /). The key rule: when a new operator arrives, pop and evaluate all operators with higher or equal precedence before pushing the new one. Evaluate Reverse Polish Notation (Simpler First) Evaluate Infix Expressions (Shunting-Yard) DE Relevance: Filter Expression Parsing Every data catalog, data quality framework, and query engine that accepts user-defined filter expressions uses this pattern internally. When a user writes 'revenue > 1000 AND category == premium OR (refunds