## xyz Interview Question for Software Developers

Country: United States

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

While one can apply simple statistics to get the answer it may not appear intuitive that it is better to always change from one's initial choice and choose the other door.

However if one considers a more extreme version of the same problem, then the answer is very intuitive... so imagine that there really was 1 million doors: your first choice would have 1 in a million chance of being correct. After you make your first choice, every door is opened except your original choice and one other door, such that the prize is either behind this door OR behind the door you originally chose. It should be clear now that your initial choice is still 1 in a million and that the other remaining door has (1 million - 1)/(1 million) chance of being the one you want.

So the chances of winning for the original question are:
- Keeping your original choice: 1/3
- Switching: 2/3 (3 - 1/3)

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

this is known as the Monty Hall problem and is used to lead into explaining Bayes theorm

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

switch the door!!

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

This is known as the Monty Hall problem. Read about it in wikipedia.

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

Well at the end it is a fifty fifty so it doesnt matter if we keep the choice or switch it.Becoz, they are anyways opening the door which has one donkey..which means either the door I have chosen is having donkey or mercedes..So the result is stale mate, eitherwise

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

I think the answer is indecisive becoz, they are anyways opening the door having one of the donkeys.So even though I chose a the door behind which there is a mercedes in the first chance or the door having the second donkey in the first hand I will always be in dilemma to switch or lock with my second choice..
Corrections/Suggestions to my answer are welcome..

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

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

I will take that donkey infront of remaining 2 doors. And punish the donkey the one which is with me. Door from which similar voice comes proves donkey behind that door and sexy merz on other one

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

It doesn't matter, whether you switch or not. Your probability will remain the same.

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

Switch the option, you will have 2/3 chances of winning, else your chances are 1/3.

Draw a truth table, it is easy to understand with that.

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.