## Microsoft interview questions

These three riddles appeared during a certain Microsoft job interview.
The interviewer would watch how the interviewee responds to these riddles. Even if they didn't get the answer, the interviewer wants to see how they think as they explain the steps they're making to TRY to solve it. Some might be too easy to solve directly! See if you can solve these.

Riddle #1:

1
1 1
2 1
1 2 1 1
1 1 1 2 2 1
3 1 2 2 1 1

What's the pattern?

Riddle #2:

You have four people at a bridge... one HAS to carry a flashlight as they cross, but only two can cross at a time. And nobody can go alone.

It only takes one 1 minute to cross. Another takes 2 minutes. Another, 5. And the last, 10.

If the person who takes 1 minute goes with the person who takes 10... it automatically takes 10 minutes.

How many minutes will it take them all to cross.. at the quickest?

Riddle #3:

You have two fuses... they burn at different rates and not at steady rates. BUT! They only burn for one hour. One could burn the entire way except one inch within one minute, then spend the last 59 on that last inch, for example.

You also have to use this to somehow time 45 minutes exactly. How would you do it?

 PhysOrg.com science news on PhysOrg.com >> Hong Kong launches first electric taxis>> Morocco to harness the wind in energy hunt>> Galaxy's Ring of Fire
 1 1 3 1 1 2 2 2 1 2 18 3 Ignite string A on both ends, string b on one end. When string A burns out, ignite string B on both ends.
 2. 17 -- AI

## Microsoft interview questions

Where are you getting your answer of 17 or 18 for question 2??

This is my answer and reason...

19 Min

1&10 cross 1 comes back 11min, 5&1 cross 1 comes back 6 min, 2&1 2 min = 19 min

How can it be done faster?

 how does one get the pattern for 1?

 Quote by z-component Riddle #2: You have four people at a bridge... one HAS to carry a flashlight as they cross, but only two can cross at a time. And nobody can go alone. It only takes one 1 minute to cross. Another takes 2 minutes. Another, 5. And the last, 10. If the person who takes 1 minute goes with the person who takes 10... it automatically takes 10 minutes. How many minutes will it take them all to cross.. at the quickest?
12 minutes. 10 & 5 cross, =10 minutes then 2 & 1 cross =2 minutes

Oh ofcourse, they throw the flashlight from one end to the other, how in the world i didnt think of this

 Quote by xJuggleboy How can it be done faster?
max(1,2)+min(1,2)+max(5,10)+min(2,5,10)+max(1,2)=17
Sorry if i am cryptic, but this was supposed to be a brain teaser

-- AI

 Quote by TenaliRaman Oh ofcourse, they throw the flashlight from one end to the other, how in the world i didnt think of this max(1,2)+min(1,2)+max(5,10)+min(2,5,10)+max(1,2)=17 Sorry if i am cryptic, but this was supposed to be a brain teaser -- AI
Why would you assume there is only one flashlight? Post said A flashlight not THE flashlight. If not two would have to cross and then two cross back (if one can't cross alone one shouldn't be able to cross back alone) and all 4 would never all get across

 Quote by 20questions Why would you assume there is only one flashlight? Post said A flashlight not THE flashlight.
Point taken and understood. But then it wouldnt be much of a brain teaser would it be?

 If not two would have to cross and then two cross back (if one can't cross alone one shouldn't be able to cross back alone) and all 4 would never all get across
quoting the question,
Only two can cross at a time
I believe this means, "at the max only two people can cross at one time" and not "exactly two people should cross the bridge at any instant".

-- AI

 very clever tenai...but then by your logic..it would only take 10 mins. i guess it all depends on your take of "noone can go alone" oh and could you plz tell me or hint to solve 1...

 Quote by neurocomp2003 very clever tenai...but then by your logic..it would only take 10 mins.
Really

 oh and could you plz tell me or hint to solve 1...
Google for Conway sequence, its one of the well known sequence and according to one paper (which is not freely available unfortunately) this sequence has many interesting properties.

-- AI

 Tenali, are you saying this? The 1 minute person has the flashlight. 1 min + 10 min cross, then 1 min + 5 min cross, then 1 min + 2min cross. = 17 mins. Now when I say 1 min + 5 min cross, I mean that 1 min is coming back to the start while 5 min is going to the end. Probably easier to see in this image: http://img11.imageshack.us/img11/28/msquestion3oa.gif
 There is no trick to breaking the rules- two people max, both same way, one flashlight. The trick is to illiminate the bad affects of the 10 and 5 person- think of the farmer, the fox, the chicken, and the egg riddle if you know it... 3) light one rope at both ends

 Quote by mattmns Tenali, are you saying this? Probably easier to see in this image: http://img11.imageshack.us/img11/28/msquestion3oa.gif
Err nope,
(warning : spoiler)

Assume a,b,c,d are on the left side.
Objective -> a,b,c,d to go to right side in minimum time
Constraints -> Just one flashligh, flashlight necessary to cross and bridge can balance at the max 2 people
a(1 min,flashlight),b(2 min) go right --> 2 mins
a(1 min,flashlight) goes left --> 1 mins
c(5 min,flashlight),d(10 min) go right -> 10 mins
b(2 min,flashlight) goes left --> 2 mins
a(1 min,flashlight),b(2 min) go right --> 2 mins
Total -> 2+1+10+2+2 = 17 mins

-- AI

 this was my solution..i'm not gonna white it cuz its a matter of the way you interpret the question. 10min carries flashlight.5+2+1+1+1=8 = 10.

 Quote by TenaliRaman Point taken and understood. But then it wouldnt be much of a brain teaser would it be? quoting the question, Only two can cross at a time I believe this means, "at the max only two people can cross at one time" and not "exactly two people should cross the bridge at any instant". -- AI
(Agreed, but it was the 'nobody one can go alone' line that, for me, ruled out someone crossing either way alone. Hmm, perhaps 'go' may be just mean 'go' and not 'come back'. Two people on the bridge at the same time, even if one's crossing leftward and one's crossing rightward may be legal to the rules as I saw them though.
The 3rd line implied to me that the faster person must walk slow to actually stay with the slower person, i.e. hand in hand.

Knowing other puzzles on this board maybe one of the crossers is named Nobody!
)

 Quote by 20questions (Agreed, but it was the 'nobody one can go alone' line that, for ... Knowing other puzzles on this board maybe one of the crossers is named Nobody!)
Oh well, poorly defined question, yeah probably. I guess, your solution stands good given that the concerns you have raised seem appropriate

-- AI