clypd interview question

How would you implement the auto-complete feature?