Problem
Build an in-memory spreadsheet. set(cell, expr) stores a literal number or a formula like "=A1+A2" (cell references and + only). get(cell) returns the evaluated integer value, recomputed from current inputs. Updating an input must be reflected by later reads.
The AI is deliberately fallible — it gives hints, not solutions, and sometimes proposes wrong code. It cannot touch your editor. Paste what you choose, then Run. Anything AI-derived stays UNVERIFIED until your tests go green.
Self-check
- ☐get recomputes from current values (no stale cache, or the cache is invalidated on set)
- ☐a formula references other cells and sums them
- ☐updating an input cell changes dependent reads
- ☐you stated time and space complexity
- ☐you named what happens on a reference cycle (even if you don't fully handle it)
Hints / what this doesn't test
This is an Opendoor-flavored applied problem: a small system with state and
recomputation, not a puzzle. Restate it back before coding — "So a cell is
either a number or a +-formula over other cells, and get always reflects the
latest inputs?"
What this problem does not test (say so out loud): multiplication / operator
precedence, ranges like A1:A3, and cycle handling are out of scope here — but a
senior names the cycle case (A1=B1, B1=A1) as a known gap and how they'd
detect it (visited-set during evaluation).
Tests
- ○literal
- ○formula_sum
- ○chained
- + 1 hidden test — revealed once the visible ones pass
Pair partner (병신 모드 · 버그 잡기)
gpt-4o-miniAsk for a skeleton or a test plan — not the answer. Then implement the core yourself and come back for edge cases. Remember: the partner is fallible. Verify everything by running it.
The partner sees your editor but cannot change it. Copy any suggestion in by hand, then Run to verify.
AI랑 먼저 페어하고 눌러