xAI·Software Engineer·Technical Phone Screen
- Given a dictionary of words and a list of digit-string queries, return all dictionary words whose phone keypad encoding starts with each query, sorted lexicographically. Each digit 2-9 maps to a group of letters the way old T9 phones worked.
“My first instinct was to just encode every word upfront and then for each query do a prefix scan.”