Available question text
Implement a math interpreter that processes a list of string commands acting on a single global integer x (initially 0). Commands are: ADD k (add k to x), MUL k (multiply x by k), FUN name (begin defining a named function), END (end the current function definition), and INV name (invoke a previously defined function on the current value of x). Functions do not execute when defined — only when invoked. A function body may contain ADD, MUL, and calls to other previously defined functions. There are no recursive calls or nested function definitions, and every invoked function is guaranteed to have been defined earlier. Commands execute sequentially, and functions may be invoked multiple times.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Snowflake
Math Interpreter with Function Definitions
Reported May 28, 2026 · 3 source reports
JUNIOR, MID_LEVEL
Source snapshot: Nov 12, 2026
View source