Everyone of us is using AutoSuggest everyday whether it is chatting or writing some post on internet. Most of the virtual keyboards in smartphones have this feature which suggest words while typing, if user finds suggestion correct he swipes it and he no need to write full word. This feature increases typing speed and saves time. I see this question is asked in some of the interviews where candidate is asked to design an AutoSuggest and in this article we are going to design it.
We are going to use Trie data structure to design this AutoSuggest. Trie is a tree of characters where each node may have multiple children which makes it best suit for AutoSuggest.
To go through full design, below is the video. Subscribe our YouTube channel for more similar videos: