Tesla SDE Interview Question 2021 October | 2D Dynamic Programming | Off-Campus
Question · Posted Jun 2026
Question 1: Edit Distance Problem Statement Given two strings word1 and word2, return the minimum number of operations required to convert word1 into word2. You have the following three operations permitted on a word: Insert a character Delete a character Replace a character Constraints 0 <= word1.length, word2.length <= 500 word1 and word2 consist of lowercase English letters. Example Input: word1 = "horse", word2 = "ros" Output: 3 Explanation: horse -> rorse (replace 'h' with 'r') rorse -> rose (delete ...
The full answer & interview discussion are available to premium members.
Log in Create a free account