OpenSheet: Spreadsheet with Cell Dependencies

Asked at OpenAI · Coding Questions · Difficulty: Medium · Last asked Nov 21, 2025

Design and implement a spreadsheet system called **OpenSheet** — a mini Excel. It must handle cell values, formulas, and automatic dependency resolution: cell names (e.g. `A1`, `B2`), numeric literals, and arithmetic formulas referencing other cells, while detecting and rejecting **circular dependencies**. A follow-up asks for an optimised `O(1)` `getCell` via eager recomputation using a dependency graph and topological sort.

Loading the problem…