educative.io

How would caching top searched terms help us if all we have is the prefix?

Under Caching, you suggest caching top searched terms. But we’re looking up prefixes. We don’t know what the term is going to be, because it’s not fully typed yet.
Or do you mean most frequently stored prefixes? And if you’re going to do that, wouldn’t you have to store the top 10 finished terms for each character in the entire chain up until the term completes for each of the most frequently searched prefixes? Because that sounds like the data structure we already have.