Jane Street interview question

How would you implement a solution that manages the state of a text editing program?