Amazon interview question

How to approach search function?