Amazon Interview Question

try to create a searching algorithm