Amazon interview question

try to create a searching algorithm