Excel sheet: Part 1 implement set_cell("A1", "10") and get_cell("A1"); Part 2 extends set_cell.
Asked in the technical phone screen stage. Part 2+ points-walled.
Implement process_operations(operations), where each operation is a dictionary with op, cell, and, for set, value. Values are integer strings or formulas such as "=A1+B1+4". A get returns the evaluated integer, or null if the cell has never been set. A missing cell referenced inside a formula contributes 0. Updates must affect later reads.
Example: setting A1 to 2, B1 to 3, and C1 to =A1+B1 makes get(C1) return 5. Setting C1 to =B1+4 before setting B1 makes it return 4, then 10 after B1 becomes 6.
Constraints: operations are ordered, formulas contain only +, integer literals, and cell references, and formula references do not form cycles.
def process_operations(operations):