Microsoft interview questions

469
2
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?
 

Icebreaker

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.
 
644
1
2.
17

-- AI
 

xJuggleboy

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?
 
1,349
2
how does one get the pattern for 1?
 
z-component said:
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
 
644
1
20questions said:
<snip>answer</snip>
Oh ofcourse, they throw the flashlight from one end to the other, how in the world i didnt think of this :wink:

xJuggleboy said:
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 :wink:

-- AI
 
TenaliRaman said:
Oh ofcourse, they throw the flashlight from one end to the other, how in the world i didnt think of this :wink:


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 :wink:

-- 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
 
644
1
20questions said:
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
 
1,349
2
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...
 
644
1
neurocomp2003 said:
very clever tenai...but then by your logic..it would only take 10 mins.
Really :confused:

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
 
1,062
6
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 [Broken]
 
Last edited by a moderator:
66
0
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
 
644
1
mattmns said:
Tenali, are you saying this?
<snip>
Probably easier to see in this image: http://img11.imageshack.us/img11/28/msquestion3oa.gif [Broken]
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
 
Last edited by a moderator:
1,349
2
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.
 
Last edited:
TenaliRaman said:
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!
)
 
644
1
20questions said:
(Agreed, but it was the 'nobody one can go alone' line that, for ... <snip> 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 :smile:

-- AI
 
66
0
I didnt notice the nobody can go alone line but if that were true the question would be impossible.
 
1,062
6
^ Yes exactly! That is why I think one comes back, with the flashlight, while another crosses at the same time. They are not together, but they are crossing the bridge at the same time.
 

BobG

Science Advisor
Homework Helper
110
80
TenaliRaman said:
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
Tenali, you solved the problem as it should have been written. You didn't read the way it was actually written closely enough.

"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."

As written, it pretty much makes the problem unsolvable unless you either have two flashlights or get to throw the only flashlight.
 
644
1
BobG said:
As written, it pretty much makes the problem unsolvable unless you either have two flashlights or get to throw the only flashlight.
TenaliRaman to 20questions said:
Oh well, poorly defined question, yeah probably. I guess, your solution stands good given that the concerns you have raised seem appropriate :smile:
I did accept it didnt I? Though i do believe your comment came just after read the first page and prolly didnt realise there was a second page. (I have made this mistake one time too many).

-- AI
 
1,349
2
tenali you solution doesn't have two people crossing between steps 4,5
 
644
1
neurocomp2003 said:
tenali you solution doesn't have two people crossing between steps 4,5
TenaliRaman said:
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
<snip>
BobG said:
Tenali, you solved the problem as it should have been written. You didn't read the way it was actually written closely enough.

"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."

As written, it pretty much makes the problem unsolvable unless you either have two flashlights or get to throw the only flashlight.
TenaliRaman said:
I did accept it didnt I?
These are all quotes from previous posts.

Maybe it was not understood as to what i meant by "i did accept it" ??
I accepted that 20questions' concerns were correct and so was his answer, in which case my solution becomes null and void. Should i detail out how i am wrong and when i would have been right?

To make it clear as to what happened so far,
1. I proposed a solution
2. 20questions proposed a solution
3. 20questions convinced me how he was right, given the way the question was framed
4. I accepted his answer completely, (which means i accepted that my answer wont work the way the question was framed (maybe i should bold this statement hmm?) )
5. However, in my answer, i distinctly cleared what objectives and constraints of the problems i have taken into considerations, which shows when my solution would have worked.

-- AI
P.S -> Also in my solution, there is just one man crossing even in step 2 and not just in step 4.

P.S2 -> I WAS WRONG! (This is for those who are expecting it!)
 
488
0
Other versions of this puzzle (e.g. here - there is nothing new under the sun), don't have the "no one can go alone" restriction, and without that TenaliRaman is correct. With it I would say that the problem is impossible. Maybe Microsoft decided that that was what they wanted, like the interviewee being asked into the room and told to sit down, but finding that there isn't a chair (anywhere). I can well believe that Microsoft might stress out their candidates in that way
 

AKG

Science Advisor
Homework Helper
2,559
3
z-component said:
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?
This one's been on here a bunch of times. Actually, the last time I saw Microsoft riddles, they were a lot harder than these. Are you sure these are Microsoft riddles? Anyways:

1 3 1 1 2 2 2 1
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?
First 1 and 2 go across, then 1 comes back. Then 10 and 5 go across and then 2 comes back. Then 1 and 2 go across. Total time: 2 + 1 + 10 + 2 + 2 = 17.

I have a strong feeling these aren't even Microsoft riddles. I've seen these before, some of them quite a while ago, and never thought they were from Microsoft.
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?
Take fuse A and light both ends. At the same time, light only one end of fuse B. Fuse A will extinguish after precisely half an hour. At the exact time that it extinguishes, ignite the other end of fuse B. When fuse B has extinguished, exactly 45 minutes will have elapsed.
 

Related Threads for: Microsoft interview questions

  • Posted
Replies
4
Views
4K
  • Posted
2
Replies
45
Views
5K
  • Posted
Replies
3
Views
2K
Replies
1
Views
1K
  • Posted
Replies
6
Views
3K
  • Posted
2 3 4
Replies
82
Views
3K
  • Posted
Replies
10
Views
3K
Replies
7
Views
485

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving

Hot Threads

Top