Design a Spreadsheet: Formula Evaluation
A Rippling coding round often opens with a spreadsheet. You implement set_cell(cell, value) and get_cell(cell), where a value is either a number or a formula like "=A1+B2" that adds other cells together. Set A1 to 5, set A2 to "=A1+3", and get_cell("A2") returns 8. Change A1 to 10 and ask again, and now it is 13. The formula tracks whatever its cells hold at the moment you read it, so the interesting work is resolving references on demand.
One decision carries the whole problem, and you make it before writing get_cell: store what the user typed, not what it evaluates to. A number cell holds its number. A formula cell holds the formula text. When someone reads a cell, you evaluate the formula right then, walking into each cell it references and asking the same question of them. Compute the result at set time instead, and you have frozen a number that a later edit to a referenced cell can never update.
- 1 problem, worked step by step
- about 18 min
Premium lessonRippling interview guide
These took digging.
What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.
100 companies. Checked every month.
Unlock all 100 companies$49 a year · less than $1 a week · Cancel anytime
Rippling interview guideKnow what Rippling asks before you walk in.
8 coding · 3 system design · 24 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.