S&P Global Interview Question

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