Mini Compiler

Asked at Applied Intuition · Coding Questions · Difficulty: Medium · Last asked Jul 15, 2026

Design a mini compiler to parse and evaluate a string of simple arithmetic expressions, supporting basic operations (addition, subtraction, multiplication, division) and parentheses. Assume the input is always valid. Supported operators include +, -, *, /. The precedence follows standard arithmetic rules. Input is a single line string, such as "3 + (2 * (1 + 1))". Return the integer result of the evaluation. Provide at least 3 test cases.

Loading the problem…