Notion·Software Engineer·Technical Phone Screen
- Implement a TextDocument class in Python that supports inserting characters at the end, deleting characters from the end, and undo/redo functionality. A skeleton with the class structure is provided. After any new operation is applied, the redo history should be cleared. Operations should run in time proportional to the size of the change, not the full document size.
“The skeleton made it feel approachable at first but I got tripped up on the undo storage.”