@Priyotosh2001
You mean Mary starts from 2 and starts asking whether is it right number?( If Bob says yes then it is best case) Hence Bob says No then Mary asks for 2^2 ...if again Bob says No then Mary asks for 2^3 and so on .... Till 2^10.
But suppose Bob was written number 663. Now suppose Mary at 9th step and asks for 2^9 and Bob says No the again Mary will ask for 2^10(>1000) Bob will say No, Mary failed here.....
That's why I have said Mary would ask for two questions in each step: (1) whether it was correct number that she had chosen and (2) whether is it greater or less from the number she has chosen.
So according to this she starts from choosing number 1000 (suppose Bob was written the number 663) and asks to Bob, Bob says No then again Mary asks second question whether is it greater Bob will say YES and Mary will do 1000/2(=500). Now in next step Mary will ask to Bob whether 500 is correct Bob will say No and again she ask question whether is it greater Bob will say No then Mary will do 500 + 500/2(=750) so like this.... It is same as binary search.
Since in question it is asked for number of questions Mary asks, and now it is clear that Mary asks 2 questions in each step and in worst case there will be 10 steps hence total number of questions asked by Mary would be 20