Duolingo·Software Engineer·Technical Phone Screen
- Given a list of word-translation hint objects (each with a source word, a list of translations, a confidence score, and a language pair), sort them by score descending, then source word alphabetically, then by the length of the first translation ascending. Implement this in Python.
- What is the runtime complexity of your sorting solution, and how would you extend it to support additional or configurable sort criteria?
“I knew the tuple key trick with sorted() so the implementation came out clean pretty fast.”