← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Design a spreadsheet-like system that supports two operations: set a cell value to either an integer or a sum formula that references other cells, and get the current value of a cell. When a cell’s formula changes, all cells that directly or indirectly depend on it must be updated automatically. A sum formula is represented as a list of cell references (e.g., ["A1", "B2", "C3"]) and its value is the sum of the values of those cells. You must handle dynamic updates efficiently and detect cyclic references: if setting a formula would create a cycle, the operation should fail and leave the sheet unchanged.