S&P Global interview question

Design "Undo" and "Redo" feature for a text editor.