Given the start word, end word, and the dictionary, find the length of the shortest transformation sequence from start to end,
Dictionary Path
The main aim of this question is to assess your proficiency as a software engineer. Imagine it is the beginning of a new project, and this question is the foundation of it. Think about readability, code quality and testability of your solution.
After solving this problem please provide a short answer to the following questions:
How did you approach solving this problem?
How did you check that your solution is correct?
Specify any assumptions that you have made.
You can write the solution to this problem in the language of your choice. When finished please send us all the source code including your tests and answer each question
The solution will be judged by:
Correctness (did you cover all edge cases)
Quality of Code
Readability
Your answers to the three questions above
Please send a zip of the solution back to your contact; specifying what language you have used and with only one step to run the code and tests. Attached zips of code or executables can be caught in spam filters, it might be safest to link us to your preferred Drive / Dropbox / cloud storage platform.
Task
Given the start word, end word, and the dictionary, find the length of the shortest transformation sequence from start to end, such that:
Only one letter can be changed at a time
Each intermediate word must exist in the given dictionary
At each step, exactly one character is replaced with another character
For example:
start = “lack” end = “mock”
dictionary = [“lack”,”hack”,”lick”,”sick”,”sock”,”mock”]
The shortest transformation is lack -> lick -> sick -> sock -> mock, and the length is 4.
Note: All words have the same length. All words contain only lowercase alphabetic characters. You may hard code example data into your app, not need to read input or files.