Level: Unknown Level
Round: Online Assessment · Type: Coding · Difficulty: 6/10 · Duration: 60 min · Interviewer: Neutral
Location: San Francisco Bay Area
Interview date: 2026-03-13
I was asked to implement a SnowCal language interpreter.
The task involved interpreting a simple coding language called SnowCal. The language has commands such as ADD, MUL, FUN, END, and INV. The goal was to execute a given list of instructions and return the final value of the variable X. Functions defined with FUN and END are only executed when called using INV.
The problem statement provided the following:
Problem Overview SnowCal is a simple coding language. It stores exactly one integer, X, in memory. The value of X always starts at 0.
Available Commands The language uses the following instructions:
Important: Commands inside a function (FUN ... END) do not run immediately. They only change X when that function is called using INV.
` Case 1
Input: program = ["MUL 2", "ADD 3"]
Output: 3
Explanation:
X starts at 0. MUL 2: 0 * 2 equals 0. ADD 3: 0 + 3 equals 3.
`
` Case 2
Input: program = ["FUN INCREMENT", "ADD 1", "END", "INV INCREMENT", "MUL 2", "ADD 3"]
Output: 5 `
` Case 3
Input: program = ["FUN INCREMENT", "ADD 1", "END", "FUN INCREMENT2", "ADD 1", "MUL 2", "END", "MUL 2", "INV INCREMENT2", "ADD 3", "INV INCREMENT"]
Output: 6 `
Input Limits The list of program lines is between 1 and 10,000 items long. Each line is one of the valid commands listed above. Y is an integer between -1,000,000,000 and 1,000,000,000. There are no nested functions.