BuyHatke interview question

Design pattern problem can be solved using binarysearch and hashing