# Puzzle Interview Questions

interview questions shared by candidates

## Puzzle Interview Questions

An array of 99 elements contains integers from 1 to 100 with one missing element. Find the missing element. 22 Answers100 1. calculate the sum of elements in array say SUM 2. sum of numbers 1 to 100 is(n* (n+1))/2 = 5050 when n==100 3. missing element is (5050-SUM) 100 Show More Responses The parameters of the question do not allow you to determine what element is missing. Either more information should be supplied, or all answers are equally correct. How could an array size of 99 elements contain 1 - 100? Should either be integers 1-99 or 2-100 , in either case there is no missing element. All indices are accounted for. Sum them and then subtract them from 5050. In general, if an array of size n - 1 elements has unique elements from 1 to n, then the missing element can be found by subtracting the sum of the elements in the array from sum(1 ... n) = n * (n + 1) / 2. Alternately, one could use a boolean array of length n with all values set to false and then for each value, set array[val - 1] to true. To find the missing value, scan through the array and find the index which is set to false. Return index + 1. This requires O(n) memory and two passes over an O(n) array (instead of constant memory and one pass), but has the advantage of actually allowing you to verify whether or not the input was well formed. Admittedly, this question is poorly posed; however, the answer they are looking for refers to the syntax/nomenclature of some (not all) programming languages to index arrays starting at “0.” As such the 1-100 stored values would be in entries 0-99 of the array. Read the question. Here are the steps to solve it: 1) find the sum of integers 1 to 100 2) subtract the sum of the 99 members of your set 3) the result is your missing element! Very satisfying! Sort array. While loop with an index variable with condition of next element being 1 greater than previous element. When loop breaks, return the value of the index. Doing the expected sum and subtracting the actual gives the run time of O(2n), however a bucket sort will almost always do it in less time (somewhere between O(n) and O(2n)): 1. create a 101-int (or boolean) array (to have a 100-index) 2. traverse original and for each int, assign value in bucket array to 1 or true. 3.After first traversal, traverse created array starting at one, and when value is false, print it. 100 100 coz in array it initial value starts frm 0 to 100. or else 4 further clarification u can study array chapter in c or c++ 100 Show More Responses The question: "An array of 99 elements contains integers from 1 to 100 with one missing element. Find the missing element." The information states that the integer count is 1 to 100. I take this to be inclusive of all elements in the array so that the missing inters would be subjective to their arrangement or random. In other words, I do not have enough information to say which one. 1 I need more information. 1. Are the integers unique in this array? 2. Do I have enough information to find the sum of the integers in the array (or some aggregation)? If sum is available, then, the answer is 5050-sum{integers}. Bucket Sort works and summation works. I think both are good, practical and clever solutions. I think sorting the array then searching may be unnecessary computation. Another interesting method which may be faster. SIMD computers may do this particularly quickly: Do a bitwise operation on all the elements: Result = Array[0] xor Array[1] xor ... Array[98] xor 1 xor 2 xor ... xor 100 Result = Missing number. Explanation: When you xor 2 identical numbers your result = 0. For example, 5 xor 5 -> 101 xor 101 = 000. (5 in decimal is 101 in binary). Knowing that "xoring" 2 identical numbers results in zero is useful. Now we apply this useful info to the problem. Array is Identical to a list of 1,2,3,...,100 except for one number. In other words 1,2,3,...,100 duplicates all of array's elements and adds one extra element that is missing in Array. Therefore, we now have 2 instances of each element in the Array in addition to one extra element in 1,2,3,...,100. We can see when you xor two duplicate numbers you get zero. Because we have pairs for all numbers in Array and one extra number we are essentially "xoring" the missing number with zero. When we xor the missing number with zero we get the missing number. (For example, 6 xor 0 -> 110 xor 000 = 110) The question states that one (not two or three or n) element ("value") from 1 to 100 is missing. There are 99 elements ("values") in the array. The question implies that the data is well-formed because it states that only element is missing. It doesn't ask you to find the missing value(s), but the one (singular) missing element. With the problem constrained, the solution falls out. Subtracting from 5050 is an elegant solution, but not obvious as to why it works. The array of booleans is more obvious, but doesn't scale well. I agree with one of the answers in this thread...5050-sum(elements) = missing item. Other approach that crossed my mind is something similar to binary search. Check the index of 50th element: if A(50) == 50, the missing element > 50, else if A(50) > 50, missing element <50. Do this iteratively. The number of comparisons would be log 100 = 7. 0 100 Add 1-100 to a hash of 100 elements. Then compare each element with the hash.. Answer in o(n) |

### Software QA Engineer at Apple was asked...

There are three boxes, one contains only apples, one contains only oranges, and one contains both apples and oranges. The boxes have been incorrectly labeled such that no label identifies the actual contents of the box it labels. Opening just one box, and without looking in the box, you take out one piece of fruit. By looking at the fruit, how can you immediately label all of the boxes correctly? 38 AnswersAll the three boxes are names incorrectly. SO the bax lebeled Apples+Oranges contains only Oranges or Only Apples. Pick one fruit from it. If it is Orange then lebel the box as Orange. So the box lebeled Oranges contains Apples and the remaining contains both. Label the boxes fruit. The key bit is "All the three boxes are names incorrectly" so the label on the box which fruit comes from will need to be changes to one of the other 2 labels. It can only be 1 of them (and it will be obvious when you have the fruit) then the remaining box (that hasnt featured yet)...Just swap that label with fruit box that was originally on the box which you took the fruit out of Thats hard for anybody to understand somebody elses explanation... eaiest way is to just do an example Show More Responses Swaz answer is almost correct however it does not work in all scenarios. lets assume: box 1 is labelled Oranges (O) box 2 is labelled Apples (A) box 3 is labelled Apples and Oranges (A+O) and that ALL THREE BOXES ARE LABELLED INCORRECTLY" Pick a fruit from box 1, 1) if you pick an Orange: - box 1's real label can only be O or A+O - box 1's current label is O - since ALL LABELS ARE INCORRECT then box 1's real label can not be O - box 1's new label should then be A+O by elimination - since ALL LABELS ARE INCORRECT - box 2's label is changed to O - box 3's label is changed to A - SOLVED 2) if you pick an Apple: - box 1's real label can only be A or A+O - box 1's current label is O - since ALL LABELS ARE INCORRECT then box 1's real label can not be O - this still leaves us with the choice between label A and label A+O - which would both be correct - FAILURE Solution: The trick is to actually pick a fruit from the A+O labeled box Pick a fruit from box 3: 1) if you pick an Orange: - box 3's real label can only be O or A - box 3's current label is A+O - since ALL LABELS ARE INCORRECT then box 3's real label can not be A+O - box 3's new label should then be O by elimination - since ALL LABELS ARE INCORRECT - box 1's label is changed to A - box 2's label is changed to A+O - SOLVED 2) if you pick an Apple: - box 3's real label can only be O or A - box 3's current label is A+O - since ALL LABELS ARE INCORRECT then box 3's real label can not be A+O - box 3's new label should then be A by elimination (not O) - since ALL LABELS ARE INCORRECT - box 1's label is changed to A+O - box 2's label is changed to O - SOLVED it only says you can't look, doesn't mean you can't feel around or smell the fruit you picked, easy deduction after you figure the first box out Sagmi is right, but did not give the full reasoning. "the bax lebeled Apples+Oranges contains only Oranges or Only Apples. Pick one fruit from it. If it is Orange then lebel the box as Orange." so far so good Now, the box labelled Apples cannot be the box containing only Oranges, you've just found that box, so it must contain Apples and Oranges. And in that case the other box, labelled Oranges, must contain only Apples. It's easier to draw it out. There are only 2 possible combinations when all labels are tagged incorrectly. All you need to do is pick one fruit from the one marked "Apples + Oranges". If it's Apple, then change "Apple + Orange" to "Apple" The "Apple" one change to "Orange" The "Orange one change to "Apple + Orange" If it's Orange, then change "Apple + Orange" to "Orange" The "Apple" one change to "Apple + Orange" The "Orange" one change to ""Apple" Since all 3 boxes are labled incorectly Start with the box Labled A&O. If Its apples than the box labled apples then the apple one is oranges and the oranges is O&A. Label each box "Apples and/or Oranges" and the all will be correct. This is very simple to resolve. I was asked the same question at FileMaker. Each box is incorrectly labeled. So you go to the box that is labeled "Oranges and Apples" and take one out. It doesn't matter what comes out because all that you know is that it is not AO. If you remove an Apple then move the Apple label to it. Since the Apples are already identified it is easy to resolve the rest. All you know for certain is that the other two boxes remaining are mislabeled. So the AO label goes on the box with the remaining label and that label goes on the Apple box as you have already assigned that. The end result is you only need to remove one piece of fruit to figure out the proper locations of all. Go down the road to HP. Maybe they are hiring. Some of these pseudo-problem solving questions like this are bunk. I was once asked why sewer covers are round and not square. I gave the correct answer without even hesitation and the interviewer seemed put off that I knew the answer. I didn't get the job but, in hindsight, no great loss. I prefer the questions (like the basketballs one from google) where you won't be able to give an accurate numerical answer but by explaining HOW you would go about solving the problem is all you need to do and MAYBE shows your aptitude for problem solving. Smell the box you opened. Step 1: Order the boxes by weight. Either apples weigh more than oranges, or oranges weigh more than apples. The mixed box will always be in the middle. Step 2: Open the first box, take out the fruit and look at it. Step 3: If the fruit is an apple, deduce that the middle is apple and oranges and that the third box is oranges. If the fruit is an orange, then deduce that the last is the box with the apples. Show More Responses Donna is the only one with any common sense. The problem with corporate America, is that it's run by a bunch of Bozos who over complicate things and have a narrow to zero vision on how to solve even the simplest problems. I can imagine that most of you would get a committee, have long meetings where you talk about 'think out of the box', and 'at the end of the day' nonsense. This is an interesting logic question, but I would not want to buy fruit from a company who knew they had a problem and then sampled one out of three boxes to resolve the issue. There are other correct answers posted. I'll just make a comment: "The boxes have been incorrectly labeled such that no label identifies the actual contents of the box it labels." Nothing in the above statement says the labels are limited to oranges/pears, only that they do not identify the contents. They could say 'nuts', 'bolts', etc. Technically, all answers should be prefaced with: assume that the labels say 'oranges', 'pears', and 'orange/pears'. Ok, the problem does not make sense and is unsolvable if the labels say 'x', 'y', 'z', but someone with (likely with a math proof back ground) may appreciate attention to detail. Q: Why do posters denigrate the interview questions? The questions, however stupid they may be, are a opportunity to show you can build an answer. Even if you pursue an invalid train of thought in the interview, it's a thought. It's what they want to see and what will help you get a job offer. Note: I also would not assume that the questions asked are a reflection on the company, department, or team as a whole. It may just be the interviewer that has chosen poorly. So to say "I don't want to work for company X because they asked me a stupid interview question" is pretty closed minded. To even think I don't want to work with that interviewer just based on questions asked seems extreme. rightly pointed out by Sagmi ... this question was put forward to me at Huawei Technologies and that was the answer I gave So the question was asked at an interview for Apple: Label ALL the boxes apple and charge a ridiculous price for them! Just label all of them "Fruit." Put another way, it is not possible to tell since we don't know how the boxes are mis-labled. What if the Apple box was labeled Oranges and both the other boxes were labeled Apples and no box was labled Apples and Oranges? You might have assumed there are three different labels when their might have only been two different labels. Always pict a piece of fruit from the box labelled Apple&Orange. As we know that this label is wrong, there are two possibilities: If it is apple, then wo know that this box should be labelled Apple, so we switch Apple label with the label Apple&Orange. Then Apple label is correct. We also know that the Orange label is incorrect, so we then switch Orange label and Apple&Orange label. if it is orange, then we know that this box should be labelled Orange, so we switch Orange label with label Apple&Orange. Then Orange label is correct. The same as above, we know that the Apple label is incorrect, so we switch Apple label and Apple&Orange label. If all boxes are labeled incorrectly and u pick a orange out of a box that's labeled apple/oranges change the name to oranges then change the box labeled oranges to apples and the the box labeled apples to apple and oranges... If you pick a apple out of a box labeled apples and oranges change the name to apples and then change the box labeled apples to oranges and the last to apples and oranges... If u pick a apple out of a box labeled oranges change it to apples and oranges then the box labeled oranges to apples and the box labeled apples to oranges...if you pic a orange out of a box labeled apples change it to apples and oranges and the box labeled oranges to apples and the last to apples and oranges... See the pattern? I think there is a big box and it contain two small boxes and all the labels are incorrect so big one contain two boxes that makes it carrys both orange and apples and in that thwo boxes having orange and apple respectively so if we open any box we can label it correctly Show More Responses To see the java source code of puzzle, visit: https://github.com/SanjayMadnani/com.opteamix.microthon code is taking the input by console only. You can fork or clone the repository and proceed further. You can also rise bug if you find any. Run BasketPuzzleGameTest.java class as a Junit test case to start game. if it known already that boxes labeled incorrectly, I would give it back to those who did label them and ask to fix this confusion. it is impossible to tell by opening only one box, so you have to open one more box. As mentioned already, if you start with the A+O bucket, you can solve the puzzle by pulling only one fruit, Bucket: A+O Found: A Bucket A+O > A | A+O, but since A+O label is incorrect, then it must be A Bucket O > since A is taken, the new label must be O | A+O, but since O is incorrect, it must be A+O Bucket A > since A and A+O are taken, it must be O Bucket: A+O Found: O Bucket A+O > O | A+O, but since A+O label is incorrect, then it must be O Bucket A > since O is taken, the new label must be A | A+O, but since A is incorrect it must be A+O Bucket O > since O and A+O are taken, it must be A If you are lucky, you might solve it with just one fruit even if you start with other buckets, Bucket: A Found: A Bucket: A > A | A+O, but since the A label is incorrect, it must be A+O Bucket: O > A | O, but since the O label is incorrect, it must be A Bucket: A+O > since A+O and A are taken, it must be O Bucket: O Found: O Bucket: O > O | A+O, but since the O label is incorrect, it must be A+O Bucket: A > A | O, but since the A label is incorrect, it must be O Bucket: A+O > since A+O and O are taken, it must be A If you start with the A bucket and pull an O or if you start with the O bucket and pull and A, then you are SOL and you need to pull out more fruits to figure it out. 1. Open one box and check its contents. 2. Remove the current label and apply the correct one (by removing it from one of the other boxes) 3. Since all boxes have been labeled incorrectly, switch labels between the other 2 boxes. And Voila you have all the boxes labelled correctly :) In requirement already specify that all three box labels are not correct. A+O A O Step1: First Pick an item A+O Box. If you get an Apple then it is a Apple Box. swap the label . A A+O O AS we already know in the box that label with Orange, does not contain Orange because of wrong label. So It must contain A+O. Just Swap the label A O A+O OK, all 3 boxes are incorrectly labeled. Open the one that says apples and oranges. Whatever is in there is what it is (since it cannot be apples AND oranges). Now, if there was an orange in there, apples must be in the orange box (since they cannot be in the apples box), and apples and oranges in the apples box (due to process of elimination). Get it? I guess questions like these will appear easy if you put them on paper, it is the possible combinations that become relevant, one way to approach is.. One of the key factor is all boxes are labelled incorrectly, this gives rise to only (2) combinations right To label for 1st box incorrectly you will have (2) options, once you label it then you have only choice to label the other two boxes incorrectly so 2 x 1 = 2 combinations possible i.e. Incorrect lablling options { Boxes_with_Oranges, Boxes_with_Apples, Boxes_with_Apples&Oranges } = { A, AO, O} or {AO, O, A} 2. To know for sure the contents of the boxes, you need to pick the box with either Apples or Oranges and avoid box with Apples and Oranges. So from the (2) combinations you could pick a fruit from Box_labeled AO (this will contain either Oranges or Apples) So, if you get a Orange, it means that combination is{AO, O, A} , so that means Box_with_Label_O has Apples, Box_with_Label_A has Apples and Oranges Box_with_label_AO has Oranges or else if you get a Apple that combination is {A, AO, O}. Box_with_Label_AO has Apples, Box_with_Label_O has Apples and Oranges Box_with_label_A has Oranges Then you can correctly label all the 3 boxes. First answer in this post is correct, as its said all boxes doesnt reflect correct items in it, If an apple is picked from a box , then it can be from either A/O box or A box, if the box is names A/O the, the label of the box has to be changed to A, then other two box labels to be accordingly. It is interesting that in 6 years people keep overthinking this. The answer is in the question and the criteria are that the boxes are immediately labeled and they are labeled correctly. ANSWER: FRUIT FYI you don't even need to open one box. Show More Responses Your choice going to be (( 2 apple 1 orange)) or (( 2orange 1apple )) . It can be recognize only one box (x) . U have to chose again until u get another formula then u will named easly . Step 1: Open a box labeled ‘Apples and Oranges’. We know that this box does not contain ‘Mixture’ for sure. If this fruit is an apple, then label this box as ‘Apple’. Step 2: (Very important) If we look at the box labeled as ‘Oranges’, we know that since the label is incorrect, this box either has only apples in it or has Mixture. Since we already know which box contains only apples, we know that the box labeled as ‘Oranges’ contains ‘Mixture’. So label it as ‘Mixture’. Step 3: (Very easy) The 3rd box will be labeled as ‘Oranges’. When you put your hands on the box to pick the fruits by touching every fruits you can feel whether all are apple or oranges or both and just pick one to see.So it is not necessary to pick one fruit and see whether it is orange or apple also it is not said in question that you can touch and feel all the fruits inside the boxes without taking it out .and then you can fix the label correctly on the boxes. Absurd, no logic km I will took a pen and stab the apple. and then ? apple-pen. |

How to measure 9 minutes using only a 4 minute and 7 minute hourglass 15 Answershttp://www.abc.net.au/science/surfingscientist/pdf/conundrum9.pdf http://www.ronbarnette.com/Zeno/result7.html The key is understanding that you will have to use the two hourglasses together. Since this problem could be asked in many ways using different values for the hourglasses and the total amount of time, it's more important to understand how you use the tools rather than memorize a specific example. The question is used to determine those who can apply their knowledge to solve problems vs. those who memorize answers "from the book". Start both timers. After four minutes, the four-minute timer will have expired and the seven-minute timer will have three minutes remaining. Flip the four minute timer over. After seven minutes, the seven-minute timer will have expired and the four-minute timer will still have one minute left. Flip the seven-minute timer over. After eight minutes, the four-minute timer will have expired for the second time. The seven-minute timer will have accumulated one minute after it's last flip. Flip over the seven-minute timer and when it expires nine minutes will have elapsed. For extra measure, you can always throw in something like, "assuming the timers can be flipped over nearly instantly..." Show More Responses I think you made this much more complicated then it needed to be. Just flip the 7 minute hour glass, when it is done, flip the 4 minute, when you see the four minute is half way done you have 9 minutes, 7 + 2 = 9. Much easier yes?! Start both timers together. When the 4 minute timer is done, flip it. 7 minute timer will have 3 minutes left. When the 7 minute timer is done, the 4 minute timer will have 1 minute left. Now you can count to 9 minutes by simply leaving the 4 minute to expire (1 min), flip it and let it expire (4 min), flip it again and let it expire (4 min). 1 + 4 + 4 = 9 By trying unsuccessfully to show how smart he is, T$ flunked the interview question. The task is to measure nine minutes, not to guess. ultraman: all measurement systems and techniques are have an inherent accuracy and precision (or repeatability and reproduceability), so the important thing is to understand the level of accuracy and precision required, and know which technique will meet the level required. The most important thing in business is not running off to do the task you've been asked with a tool you have handy, but understanding the reason for completing the task, and knowing how the output from your work will be used by others, and how the accuracy and precision will impact of others down the value chain. Dodging the question never works, rd. Tim is correct. http://brainteaserbible.com/interview-brainteaser-hourglass-puzzle Actually, I agree with #T$. Ultraman and d-bag, the goal is to get the job done the most efficient and accurate way. The original question says it has to get done within 9 minutes as well. So you turn the 7 min timer over. While the seven minute timer is going, you take a measurement of the length of the 4 min timer, with the width of your thumb. Whatever number of thumb widths it is, divide it by 2 and that will (very accurately) give you the half way point on the hourglass which will equal to 2 minutes. Once the seven minute hourglass is done, flip the 4 minute timer. Once the 4 minute timer hits the halfway point you marked, you accurately measured 9 minutes. 1st timer 2nd timer time count 4 7...................start both timers 3 6................. 1min 2 5..................2mins 1 4..................3mins 0(flip) 3..................4mins completed 4 3..................4mins(assuming flip takes no time ideally) 3 2..................5mins 2 1..................6mins 1 0(flip)..........7mins 1 7..................7mins(again ideal flip) 0 6..................8mins(flip 2nd timer to count 1min) 0(as it is) 7..................9mins... The gist of this problem is that the only way to get an exact time is by having an hourglass empty out completely when you declare 9 minutes are reached. So let's take a holistic approach: the most time we can count using ONE of the hourglasses is 8 minutes: by starting the 4-minute hourglass, flipping it, then letting it go for another 4-minutes. Let's say we start both the 4-minute and the 7-minute hourglass at the same time. The 7-minute hourglass runs out before 8-minutes are up, so we flip it. When 8-minutes are up (measured by the 4-minute hourglass), we know 1 minute worth of sand has deposited since the 7-minute hourglass was flipped. So now flip that sand upside and down and let it drain completely, and we've reached 9 minutes. start 7 and 4 , flip 4 while 4 is gone but 7 is working , when 7 is gone , we have 1 min in 4 glass , start the timer , do 4 glass twice to count another two 4 mins : 1+ 4+ 4=9 4-4, 7-4 4 4-3 7-3 3 1-1 start timer 4 4 end timer Show More Responses Since this situation test our mental fortitude and problem solving skills, can we start by opening the lids and emptying the sand from the 4 min. Pour the sand from the 7 into the empty 4 so you are left with three. Poor out that three into a pile and fill the 7 min with the remains sand and repeat to get another three. So now you have two pile of three min sand for a total of 6. Fill up the 4 min and add the 2 pile of three min sand into the 7 min hour glass to have exactly 9 min. Set 4 minute timer to ring at teo minutes. Set seven minute timer. When it goes off , nine minutes will have passed. If you can not set the four monutes to go off after two minutes, set the sevem minute timer when the four minute is at the half way mark. |

### Program Manager at Microsoft was asked...

You are on a game show. There are three doors, behind one of which is a prize and the other two is a chunk of coal, and the host knows which door holds the prize. You choose door #1. Before it is opened, the host opens door #3 and reveals a lump of coal. You have the choice to stick with the door you chose originally or switch to door #2. What do you do? 16 AnswersSwitch doors. When you chose door #1, there was a 66% chance that the prize was not behind that door. When the host revealed the coal, there was still a 66% chance the prize was not behind the door you chose. Thus, you have double the odds of getting the prize by switching to door #2. The key to this puzzle is that the host knew which door has the prize. That is not true. The probability went from 1/3 to 1/2 once the number of doors reduced to 2. However, statistically speaking, your chances of finding the treasure are now even. So it should not matter which door you pick. Interview candidate is right. You got 1/3 chance that prize is behind door #1 and you lose if you switch. And you got 2/3 chance that prize is behind either door #2 or #3. Since the host will always eliminate the wrong one. 2/3 chance will be allocated on the left one. Show More Responses Everyone is wrong. You stay with your first pick, the odds becoming slanted greatly against the other door. Interview Candidate and Anonymous are right. This is also known as the Monte Hall problem Your choice splits the doors in two sets. Set A contains the door you selected, and the probability that is a prize behind this door is 1/3. The set B contains all remaining doors, and the probability that the winning door is somewhere in there is 2/3. By removing one door, which all have the success probability of zero because there's coal behind them, from set B, only one door remains in B, but the overall probability for success in set B is still 2/3. Therefore you must switch. I can't believe that some of the answers up here actually state that you should switch. -------------------------- Before the host showed you that door#3 was hiding coal, your chances to pick the right door where 1/3. Now that you know that coal is behind door#3, you only know that 1 of the 2 remaining doors leads to coal while the other leads to the prize. While your probability of making the right choice has increased from 1/3 to 1/2, this probability still applies to both of the doors. You can't differentiate them. Seriously. Tarik, You are correct that the right choice has increased from 1/3 to 1/2, but you have to account for variable change in this instance. Think of the same problem, but with different numbers. 100 doors, same conditions. You pick 1 door, with a 1/100 chance of being correct. The game show opens 98 doors with coal (because he knows where the prize is). He now offers you the chance to keep your door or switch to the last remaining door. In this Because of variable change you will always be better off switching doors. Scratch that, the right choice hadn't increased from 1/3 to 1/2. It's late and I have no idea why I typed that. Really??? I can see why they ask the question if so many people have so little understanding of probability. There are NOW two doors to choose from and there is one prize. DAAAAA It doesn't matter how many there were to begin with or which one of the two you originally chose. There are now two doors and each one has an equal chance of containing the prize so your odds of success do not change at all regardless if you stay with your original choice of switch to the other. The odds of your original door being the correct one were 1/3 when there were 3 option but the odds of your door being the correct one CHANGE to 1/2 when you eliminate one of the options. To say the probability of your door being correct are still 1/3 is to say that your odds of success are still one third if you were to pick door 3 even though you know it does not have the prize. As an interviewer I could have easily eliminated the majority of the applicants above. What about sticking to your original decision and not deviating without knowing the facts(Data). i will stick with my decision and might fail, sure but at list i will not make decision on just the 1/3 and 1/2 number game. Averee has given the best explanation. Before anyone writes any further comment or contradicts what he says, do yourself a favor, go on youtube and watch the video on monty hall problem - you will not object to averee's solution after that. What everyone who is answering "stick to original door" is missing the host's knowledge of which door has the prize and his actions after the first door is chosen. Host's action puts the odds of prize behind the switched door as 0.5. However, the original door still has a 0.33 probability of the prize. Yes I know it is a difficult concept to grasp - so you all need to watch the monty hall problem on youtube. Show More Responses Switching is the correct answer. Thank you Akhil. I'd like to add that the youtube video "Monty Hall Problem for Dummies - Numberphile" explained it very well. PS. Watch it twice. |

### Lot Associate at The Home Depot was asked...

What would you do if our CEO came into our store? 3 AnswersRelax, and give an honest answer relax be organized busy and appropraite I own stock in that company and have no idea who the CEO is. A clerk in that store probably wouldn't, either. The answer is that you'd treat the CEO like any other customer and help him or her find whatever they're looking for. |

### Ruby Developer at Groupon was asked...

Tiresome puzzle questions. Recommend looking up the standard ones and their solutions (no, these don't make someone a better software designer or programmer - they're a waste of time). Be prepared for a programming exercise as usual, but be prepared to ask for it in a font/format that's easier to read than Arial or whatever variable-spacing font was used, and without line-wraps. I got the impression that the printout was an afterthought, and the level of interest of the interviewer was minimal 2 Answersdropping glass-balls, line of buckets with money, board-game heuristics - google these and all favorite interview questions A blog of interview puzzles, specifically probability ones http://bayesianthink.blogspot.com/2012/11/winning-at-russian-roulette.html |

### Software Engineer at Business Logic was asked...

You have two strings and a lighter. Each string takes one hour to burn, but they burn at variable rates. So for example, after 30 minutes, you have no idea how much of the string has burnt. Using just the two strings and the lighter, determine when exactly 45 minutes have passed. 1 AnswerLight both ends of one string. At the same time, light one end of the other string. Once the first string is consumed, 30 minutes have passed. At that point, light the other end of the second string. Once the second string is consumed, 15 more minutes have passed for a total of 45 minutes. |

### Software Engineer at SmartZip Analytics was asked...

How long would it take for a set of ants to eventually walk off of a stick, if the ants would walk along the stick, instantly reversing course if they bumped into each other? 1 AnswerThe ants bumping into each other and turning around can be ignored as it is effectively as if the ants simply passed each other. In other words, it would only take as long as the ant that had the farthest to walk, essentially the length of the stick. |

Why do you think you can do for me that someone else cannot? 1 AnswerI have a great passion for my work. I become very obsessed with trying to find better and quicker ways to perform my job and organize the ciaos. I have a very strong ability to see what needs to be changed in order to simply or increase work production. |

They have some puzzles and ask you to do one. 1 AnswerThe puzzles are different and I'm not going to give you the answer. Basically if you stay calm and work it out outloud, you'll be OK. They want you to succeed as much as you do. |

**1**–

**10**of

**12**Interview Questions