GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
← Coding & DSA / 73
hard★ EssentialGoogleMetaAdobe

Compute the edit distance (Levenshtein) between two strings.

A DP classic that screens for one thing: can you define the right subproblem and fill the table without fumbling the indices. The strong version adds the O(min(m,n)) space trick and reconstructs the actual edits when the follow-up lands.

Updated Aug 2026 · Grounded in real Forward Deployed Engineer interview loops and written to a senior-engineer editorial bar.

A DP classic that screens for one thing: can you define the right subproblem and fill the table without fumbling the indices. The strong version adds the O(min(m,n)) space trick and reconstructs the actual edits when the follow-up lands.

20 answers per topic instead of 10, plus saved progress and bookmarks · no cardor unlock all 559 remaining answers · ₹2,000 / $25

Every answer, concept and course, every paper breakdown, all published video lessons, hands-on FDE Lab missions, Premium PDF guides and companion files, the full practice-test bank and work-sample downloads. Referral Premium excludes guide PDFs and their companion files.

6 months · One payment · No auto-renewal

Study alongside free video lessons.

Keep practising

FEDITOR'S NOTE

The state is the whole question. If you can say 'dp[i][j] is the distance between the first i chars of a and the first j chars of b' and then justify the three transitions, you pass. Candidates who jump to code without naming the state almost always botch the base row or the off-by-one in the loop bounds.

DISCUSSION · 0

No comments yet — be the first to share your approach.