While looking in the system design of TypeAhead/Autosuggest systems, I found out that they uses trie data structure for the suggestions and google search engine also autosug