Decode Scrambled Words Using Dictionary
Given a dictionary of valid words and scrambled words where only the middle letters are rearranged (first and last letters remain in place), decode each scrambled word by finding its matching dictionary entry.
Asked at:
Upstart
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late January, 2026
Upstart
Senior
Your friends have sent you a message and wanted to show you a funny trick. For each word in the message, the first letter and the last letter stay the same, but the letters inside are scrambled. The human brain is surprisingly able to recognize the words and automatically decode the message. For example, the word "orange" could become "ognrae" or "orgnae". You don't find that trick very fun, so you will write a program that does the decoding for you. Fortunately, your friends have a shared vocabulary; all the words they use are contained in a provided dictionary (the words array).
Hello Interview Premium
Your account is free and you can post anonymously if you choose.