SOTI interview question

Implement Undo and Redo functionality using DSA?