Back to problems

Design a String Calculator with Explicit Grammar and Evaluation Rules

System Design · Meta · Easy

You are asked to design a calculator that receives an arithmetic expression as a string and evaluates it. Before committing to an implementation, explain which language and numeric details must be clarified, then describe how you would separate tokenization, parsing, and evaluation after those decisions are fixed. Part 1 — Specify the Expression Language List the choices that need explicit definitions before coding: number format, supported operators, precedence and…

Checking your access…