Ready for another coding interview test asked by top tech companies? Well we’ve got just what you need. Give the question below a got, and share your answer on a github gist and share the link in the comments!
Implement an autocomplete system. That is, given a query string s and a set of all possible query strings, return all strings in the set that have s as a prefix.
For example, given the query string de and the set of strings [dog, deer, deal], return [deer, deal].
Hint: Try preprocessing the dictionary into a more efficient data structure to speed up queries.
Share your answer in the comments below.