FastPrepDetermine the Edit Distance in a Word Ladder
Problems/Determine the Edit Distance in a Word Ladder

Determine the Edit Distance in a Word Ladder

Adobe logoAdobe● MediumFULLTIMEOAPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamples

Problem statement

Given two words (beginWord and endWord), and a dictionary's word list, find the minimum number of operations needed to change beginWord into endWord.

You can change only one letter at a time, and each intermediate word must exist in the word list. If there is no possible transformation, return None (Python), -1 (Java & C++), null (Javascript).

Function

ladderLength(beginWord: String, endWord: String, wordList: List<String>) → int

Examples

Example 1

beginWord = "hit"endWord = "cog"wordList = ["hit", "hot", "dot", "dog", "cog"]return = 4

The transformation sequence can be: hit -> hot -> dot -> dog -> cog, which is 4 steps long.

Example 2

beginWord = "word"endWord = "word"wordList = ["word", "ward"]return = 0

Since the beginWord is the same as the endWord, no transformation is needed, so the number of steps is 0.

Example 3

beginWord = "hit"endWord = "cog"wordList = ["hit", "hot", "dot", "dog"]return = -1

The word cog is not in the list, so there is no possible transformation sequence.

More Adobe interview questions

  • Base Unit ConversionsOA · Seen Nov 2026
  • Evaluate a Parenthesized Integer ExpressionPHONE SCREEN · Seen Oct 2026
  • All Elements of Two BSTs in OrderPHONE SCREEN · Seen Aug 2026
  • Rotate an Array In PlaceOA · PHONE SCREEN · Seen Aug 2026
  • Top-Funded Villages and ProjectsOA · Seen Aug 2026
  • Binary Tree Level-Order Traversal by LevelsPHONE SCREEN · ONSITE INTERVIEW · Seen Aug 2026
  • Lowest Common Ancestor Only When Both Targets ExistONSITE INTERVIEW · Seen Aug 2026
  • Lowest Common Ancestor with Parent PointersONSITE INTERVIEW · Seen Aug 2026
  • Next and Previous Lexicographic PermutationONSITE INTERVIEW · Seen Aug 2026
  • Asteroid CollisionONSITE INTERVIEW · Seen Aug 2026

Similar questions at other companies

  • Detonate the Maximum BombsZomato / Eternal · PHONE SCREENZomato / Eternal interview questions
  • Minimize CommuteDatabricks · OA · PHONE SCREENDatabricks interview questions
  • Shortest Word Chain Between Two WordsFanatics · PHONE SCREEN
  • Course ScheduleByteDance · PHONE SCREEN · ONSITE INTERVIEWByteDance interview questions
  • Merge Accounts by Shared AttributeAmazon · PHONE SCREEN
  • Linked Merchants Within Two HopsStripe · PHONE SCREENStripe interview questions
  • Shortest Pin Path Through TopicsPinterest · PHONE SCREENPinterest interview questions
  • Shortest Travel Time in a Grid with Traffic LightsWaymo · PHONE SCREENWaymo interview questions
  • Word Chain Jumps in a GridGoogle · PHONE SCREENGoogle interview questions
  • Delivery Management SystemAkuna Capital · OAAkuna Capital interview questions

Interview reports that mention this question

  • Adobe New Grad MTS Interview Questions: 7 Experiences
  • Adobe Computer Scientist 1 Round 1: 8 Experiences (Part 4 of 12)

Adobe interview experiences

  • Adobe New Grad OA: Unit Conversion and Code Review: 1 Experience
  • Adobe Web, QA, DevOps, ML Roles: 13 Experiences (Part 3 of 3)
  • Adobe SWE Interviews, Level Unknown: 25 Experiences (Part 2 of 3)
  • Adobe Interviews, Level Unknown: 38 Experiences (Part 1 of 3)
All Adobe interview questionsSee Adobe hiring insights
Saved
class Solution {
    public int ladderLength(String beginWord, String endWord, List<String> wordList) {
      // write your code here
    }

}
Checking account…