## Snapdeal Interview Question for SDE1s

Country: India
Interview Type: Written Test

Comment hidden because of low score. Click to expand.
5
of 5 vote

This sounds similar to the problem of having two eggs to find out from which floor they will break...Answer should be 17

Comment hidden because of low score. Click to expand.
0

explain pls....it has 150 men and not 100

Comment hidden because of low score. Click to expand.
0

What is problem with binary search?.Can you explain your solution.?

Comment hidden because of low score. Click to expand.
0

Assume height[i] = i;
blindManHeight =2;

How many yes does he need to find his place??

Comment hidden because of low score. Click to expand.
4
of 4 vote

Yes n(n+1)/2 >= 150. n is approx 17

Comment hidden because of low score. Click to expand.
1
of 1 vote

I think the answer is 24.

solve for integer k such that 150/k + k - 1 is minimum. k is 12 and min is 23.5 => 24

Divide 150 men into 12 groups of 12 people and the last group has 6 people. The worst case would be that he starts on the first group and then goes down all the way to the 12th group and the man said YES. Then he go to the start of the group and ask the rest of the 11 people. You can not do binary search because once there is a second YES, you are done done.

Comment hidden because of low score. Click to expand.
0
of 0 vote

Binay search and keep a counter.

Comment hidden because of low score. Click to expand.
0

Read the problem -- binary search will give you nlogn failures in worst case, not 2.

Comment hidden because of low score. Click to expand.
0
of 0 vote

Is the blind man able to pick out midpoints?

Comment hidden because of low score. Click to expand.
0
of 0 vote

i think it should be 25

17+8 because 18*8 = 144

so 8 + 17

Comment hidden because of low score. Click to expand.
0
of 0 vote

Should not it be 12+11=23 what is wrong in this calculation?

Comment hidden because of low score. Click to expand.
0
of 0 vote

25

Comment hidden because of low score. Click to expand.
0
of 0 vote

Let's say height of Blind man is 5.
people stand in
1, 1.5, 2, 2.5,3,3.5,4,4.5,6,6.5,7,7.5,8.0,8.5 = 14 total count
as he know total count, he will reach to middle (i.e. 4 and ask "Am I taller than you?" )
1st Yes,
(As NOs can be unlimited), he can iterate from 4.5 to 6.5, at 7 he gets asnwer last yes, gets placed. (so total iterations are less than n/2)

Comment hidden because of low score. Click to expand.
0
of 0 vote

Is this puzzle solvable if

1)All the men are taller than him?

2)All the men are shorter than him?

Comment hidden because of low score. Click to expand.
0
of 0 vote

The blind man will ask questions to in order 17, 33,(17+16), 48(17+16+15),.....,150(17+16+15+....+5+4+3).

Now lets say 17th man answer yes then he will ask question to each guy from 1st to 16th and worst case can be 1+16=17.
or lets say 48th man answer yes then he will ask question to each guy from 34th to 47th and worst case can be 3 + 14 = 17

in same way u go further and find worst case 17.

Comment hidden because of low score. Click to expand.
0

hi, why he will ask from 34th to 47th, why not from 18th to 47th, i am not clear, can you please answer to accesssantu@gmail.com, if you find some time. Thanks in advance...

Comment hidden because of low score. Click to expand.
0
of 0 vote

(28x5)+9=149
worst case=149

Comment hidden because of low score. Click to expand.
0
of 0 vote

150/5=30+1(First)+2(yes)=33

He start asking every fifth to make it faster but start with the first in the line.
1=yes if no 5=yes then he gonna ask 2,3,4 until he one of them answer him yes again, so he have 2 YES. |worst case possible he taller than all of them or the last person answer him yes|
{1;5;10;15;20;25;... ...;145;150}=31+2(yes)=33

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.