Microsoft Interview Question for Software Engineer / Developers


Country: United States
Interview Type: In-Person




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

Suppose jar 1 is labelled lemon
jar 2 -> banana
jar 3 -> Mix
Take a candy from the jar 3 which is labelled as Mix of both and eat.

Suppose it is lemon, take the lemon label from the jar 1 and place it on jar 3. Now we are done. jar 2 will be mix, jar 1 banana from the fact that all jars have wrong labels.

Same logic goes in case it turns out to be banana candy after eating.

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

Lets lebel them as B, L, BL

Since all have incorrect lebel, 'BL' is lebelled as either 'B' or 'L'. That's why we should not pick to taste from the jar that's either lebelled as 'B' or 'L'. Pick one from the jar which is lebelled as 'BL', if it comes out as 'B' then the one that's lebelled 'L' is 'BL', if it comes out 'L' then the one lebelled as 'B' is 'BL'.

- rk November 14, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

what is the question

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

Determine the correct jar labels.

- rpisid November 14, 2013 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Suppose correctly label is 1 -> B, 2 -> L, 3 -> BL.
Accroding to question, suppose all labeled incorrectly, then only two case is 1 -> L, 2 -> BL, 3 -> B or 1 -> BL, 2 -> B, 3 -> L. So that, we can deduce labelled BL is only one taste candy, then we can pick up one candy from BL, if it is B, we can reasoning backward accroding to 1 -> L, 2 -> BL, 3 -> B, instead is 1 -> BL, 2 -> B, 3 -> L.
If question contain which one label is correctly, then I think we need more condition to solve it.

- jarwemailsky@126.com November 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

lets say
j1 is banana
j2 is lemon
j3 is mix

I would eat a candy from jar j3(labeled a mixed one) and whatever I got(either banana or lemon), then this j3 must be this kind of type, it is not mix for sure. lets suppose my candy was lemon, so
j3 will be lemon
j1 will be mix ////it can not stay mix, because all jar labels are messed up
j2 will be banana//it can not stay lemon, because all jar labels are messed up

- elber.kam November 18, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Legend: B for banana, L for Lemon , BL for mix
You don't consider anything you just pick one candy from the jar labelled BL and here you have two cases
1- if its lemon then you stick "L" to it and stick the "BL" to the jar labelled "B" and finally the "BL" should be placed on the final jar which is previously labelled "L".
2- if its banana then you stick "B" to it and stick the "BL" to the jar labelled "L" and finally the "BL" should be placed on the final jar which is previously labelled "B".

- Unknown February 21, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Take a candy from the Mix jar. If its a lemon then its definitely a lemon jar labelled as Mix coz the other two jars Mix and Banana wud be wrongly labelled as Banana and Lemon respectively else we wont get all wrongly labelled jars. Same goes for if the Mix jar has a banana candy in the first go.

- Shankey April 27, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Let the Jars be Jar1 , Jar2 , Jar3.  Assume Jar1 contain label  Banana (B), Jar2 Lemon(L) and Jar3 Mixed(M).  Since all are wrongly labelled ,  Jar3 will be either banana or lemon and not mixed. Taste a candie from Jar3 and assume it tastes as Banana Now, to find out mixed and lemon.Jar2 is labelled as Lemon , so it does not contain lemon. So Jar2 will be mixed and Jar1 will be lemon.

- Soumya December 24, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

As far as questions go, this is pointlessly easy and uninformative when people do/don't get it.
I have seen this asked as: "provided a strategy for figuring out which jar is which, while minimizing candy consumption", which is slightly harder in practice, but tends to be more informative.

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

Hats off to your knowledge ....!

- Anonymous January 17, 2014 | Flag


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