System Design · Instacart · Medium
Design a variable-resolution engine. Each definition has the form name = value, where value is restricted to either one integer literal or the name of one other variable. The right side is never an arithmetic expression. A query asks for the integer value of a variable. To answer it, repeatedly replace a variable reference with the right side of its definition until an integer literal is reached. The resolver must handle duplicate definitions, references to undefined names,…
Checking your access…