Paisabazaar.com interview question

2 search problem in dsa was asked