Figma·Machine Learning Engineer·Technical Phone Screen
- You're building a layer/document editor (think Figma-like) that supports mutating operations and an Undo command. Implement Redo such that it re-applies the most recently undone operation, handles batched operations as atomic units, and invalidates the redo stack whenever a new mutation occurs after an Undo.
“The basic redo stack wasn't bad, two stacks, push to redo on undo, pop from redo on redo, clear redo on new mutation.”