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)

- Greenskid July 31, 2015 | Flag Reply
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

- Anonymous October 21, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

switch the door!!

- Devil July 31, 2015 | Flag Reply
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.

- 010010.bin July 31, 2015 | Flag Reply
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

- nathan August 18, 2015 | Flag Reply
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..

- ksnathan0202 August 18, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

switching is the correct answer

- cr August 21, 2015 | Flag Reply
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

- ADO November 28, 2015 | Flag Reply
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.

- NGD December 14, 2015 | Flag Reply
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.

- Sreenath Reddy July 18, 2016 | Flag Reply


Add a Comment
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.

Learn More

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.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More