Text editor in stages: buffer, undo and redo, autocomplete, collaboration
Build the core of a text editor in four stages, each on top of the last, so keep the design easy to extend:
- A text buffer with insert and delete at a position.
- Undo and redo of those edits.
- Word autocomplete backed by a trie: given a prefix, suggest words already in the document.
- Collaborative editing: two users edit the same document at once, and their concurrent edits are reconciled with operational transformation so both end with the same text.
Most candidates do not reach the last stage, so keep the early stages simple and correct.
No answer yet. Write the first one; the best answer gets endorsed.
