# Edit Distance Three Operations **Idea.** dp over prefixes with insert, delete and replace costs. **Complexity.** State time and space before coding, then justify why the approach beats brute force. **Interview tip.** Restate constraints, give brute force first, then optimize. Trace one small example out loud before coding. *Disclosure: practice note shared by the Linkjob AI team.* For live mock-interview practice see [Linkjob AI](https://www.linkjob.ai/).