Rokt interview question

Imagine you are creating google docs, implement redo and undo functions.