Bloomberg LP Interview Question
Financial Software DevelopersAll the labels are incorrect, so pick a fruit from the mixed box. That will tell you if its the apple or orange box. The other labels are also incorrect, so the box labeled with the fruit you picked will be the box containing just the other type of fruit. The remaining one will be the mixed box.
Directly pick one fruit from box labeled Mixed(This is def going to contain only either of the fruit, because of incorrect label).. now correct name of this label can be found(If u get apple, the correct label for this is apple else orange). Now say u have got apple, the box which says Orange can only be Apple or mixed, now since we have found which is apple box, this can only be mixed. and finally the one that says apple is Orange box
The key to the solution is given in the question "all the boxes are labelled incorrectly", so the "box with the mix of apple and oranges" should be either a "box with an apple" or a "box with an orange"
Step 1 : Pick up a fruit from the mixed box, if it is apple then the box is "apple only box", if it is orange then it is "orange only box".
Step 2 : Lets say we get "orange" from the "mixed box", so the box labelled as "only orange" should be mixed "mixed box", and the "apple only box" should be "orange only box
Remember that all boxes are labeled incorrectly.
- lurker December 02, 2010The box marked "mixed" is not the mixed box. Pull a fruit from it. Say it's an apple. It must be the "apples" box.
The box marked "oranges" is not the box with oranges. It's also not the box with apples. It must be the "mixed" box.
There is one box left. It is neither the "apples" nor the "mixed" box. It must be the "oranges" box.