Loading…
Design a Text Editor with Undo and Redo is a hard low-level design interview question covering low level design, object oriented design, command pattern, design patterns, data structures — the kind asked at FAANG (Facebook/Meta, Apple, Amazon, Netflix, Google) and AI-first companies like Anthropic, OpenAI, and Nvidia.
Design a single-user text editor. Documents can reach a few megabytes and typing must never stutter. It supports find and replace including replace-all, a cursor with a selection, and unlimited undo and redo. Undo should match what a user thinks they did: typing a sentence then undoing should not remove one letter, and a replace-all of thousands of occurrences should be a single undo. Undo must still work after saving.
Interactive walkthrough on Pro
Upgrade to Pro to unlock the clarifying questions, the class model, the code, tradeoffs, follow-up answers, and the model answer.
What's inside this guide
Fully unlocked, no account needed — solutions, walkthroughs and follow-up answers included.
Or start the Study Plan — a week-by-week order for your loop, and week 1 is entirely free.
A full interview loop is more than one round. These are the others, each with what is on the site for it.