All problems
Foundational·🛠️ Developer Tools·Microsoft · Google

Design
Text Editor with Undo/Redo

Design a simple text editor supporting insert, delete, and multi-level undo/redo of edits.

This is a Low-Level Design (LLD) problem. New to LLD vs HLD? Start here.

#Command Pattern#OOP
6F + 2NF requirements inside

01 -  Why interviewers ask this

It pairs the Command pattern with a real data-structure decision (how to represent large mutable text) — a good test of whether you think about scale even in a "simple" feature.

02 -  Where this system exists in the real world

You interact with this design every day.

Text editors and IDEs (undo/redo stacks)

Word processors with edit history

Collaborative document editors

03 -  What you'll master

Solve this once. Know it forever.

01

Apply Command pattern to insert/delete operations

02

Manage undo/redo stack branching correctly

03

Consider efficient text storage for large documents

04 -  What you'll design

6 functional · 2 non-functional requirements.

Insert text at a given cursor position

5 more requirements inside

Sign in to unlock the full brief and start designing

05 -  Companies that ask this

You may face this exact question in your next interview.

M
Microsoft
G
Google

Ready?

Open the canvas.
Design it yourself.

See all requirements, use staged hints, run your code, and compare with community discussions - all on the same canvas.