Microsoft Interview Question for Interns


Country: United States
Interview Type: Phone Interview




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

always picking from the basket labelled "mixed".

If picking an apple, this "mixed" is actually apple basket, the one labelled "orange" is actually mixed basket. The left one is orange basket.

If picking an orange, the one labelled "mixed" is orange, the one labelled "apple" is mixed basket, and the left one is apple.

- Jason November 15, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

how can we say that : if picking an apple, this " mixed" is actually apple basket????

- zil December 24, 2013 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

@zil: Because all labels are incorrect. "Mixed" can only have apples, or oranges, but not mixed.

- Anonymous December 25, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can you explain better please?

- oxymoron November 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Suppose Basket labelled "Apples" is Basket#1,
Basket labelled "Oranges" is Basket#2, and
Basket labelled "Mixed" is Basket#3.

Take a fruit from the Basket#3.
If the fruit picked is Apple, take the "Apples" label from the Basket#1 and place it on Basket#3 and we are done.
Basket#2 will be labelled with "Mixed", Basket#1 will be labelled as "Oranges" from the fact that all baskets are labelled incorrectly.

Same logic goes in case the fruit taken turns out to be Orange.

- Rakesh Roy November 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This question was already asked: id=5428361417457664

- Rakesh Roy November 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

okay... So lets pick from basket 'Mixed' (it can be either Orange or Apple, as its not mixed)
Case 1 : its an Orange
Result : Now, 'Mixed' becomes 'Orange', and we left with two baskets, Orange & Apple, label 'Orange' as 'Apple' and 'Apple' as 'Mixed' because we know they are wrongly labeled and we already got Orange basket in first step.

Case 2: we got an apple
Result : mark 'Mixed' as Apple, and A -> O and O -> M

- rsh December 25, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Excellent answer

- Johnny January 01, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Box# : Box1, Box2, Box3
Label# : Apple, Orange, Mixed
Let's pick a fruit from Box3 (Labeled as Mixed). Now, as per the problem statement this box is not actually a mixed one which means it is either an orange box or an apple box.

Case 1: if the fruit which we picked happens to be an Orange:
1. Box3 is Orange Box
2. Box2 which is labeled Orange is actually Apple box
3. Box1 is actually a mixed box.
for this case the Correct Order is written below:
Box# : Box1, Box2, Box3
Label# : Mixed, Apple, Orange


Case 2: if the fruit which we picked happens to be an Apple:
1. Box3 is Apple Box
2. Box2 which is labeled Orange is actually Mixed box
3. Box1 is actually an Orange box.
for this case the Correct Order is written below:
Box# : Box1, Box2, Box3
Label# : Orange, Mixed, Apple

- santosh sinha October 23, 2014 | 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