# Brain teaser Interview Questions

interview questions shared by candidates

## Brain teaser Interview Questions

### Manager at Amazon was asked...

If you had 5,623 participants in a tournament, how many games would need to be played to determine the winner 61 AnswersBefore I could figure that out, I'd need to know whether the # of participants represents the number of individuals on larger teams, or the number of teams 5,622. Assuming it is a single elimination tournament. All teams lose one game except the champs. It's always # of teams - 1 Assuming it is a simple process of elimination, it takes 5622 losers to get 1 winner from 5623 participants. So, it would require 5622 games. Show More Responses Assuming it is a simple process of elimination, it takes 5622 losers to get 1 winner from 5623 participants. So, it would require 5622 games. if it's a 1:1 type draw, then # rounds = (5623)**x where x is base 2. a good answer is between 12 and 13 rounds. 2**12 = 4096 so I'd draw up 13 rounds and give out 1,527 byes. One One. Obviously. One game, all players participate. If participants equal number of teams involved, think power of 2. The interviewer is not looking for the right answer because there can be many. What he/she is looking for is your logical approach in solving the answer. So you could start by probing more is first I would like to understand if 5,623 participants represent the number of team or individuals. Then ask the next logical question based on the answer. Everyone who didn't ask a follow up question except Mike is right. The question says, "if YOU had ...". This requires no follow up questions, because YOU should decide how YOU are going to operate YOUR tournament. Why would Mike or any of the others think it's someone else's job to organize his/her tournament. Oh just a follow up. My tournament would be held in the top of a hardly dormant volcano. Everyone would get a backpack full of grenades and the first one out of the crater without dying wins. That makes 1 game. Also, I think most participants who got out of the volcano alive would consider themselves winners, but only one would get to keep the gold plated dancing chiquita banana. Yipee!!!! I'm right too! Take that Mike! it'd be one game if it was a battle to the DEATH Show More Responses I agree with Nancy there is no strict answer to this question it is all about problem solving. First thing to do is to get more information, if it is not forthcoming then make assumptions, as an interviewer I would not be impressed if the candidate didn't ask for more information, although I probably would not supply any more. Then looking for a logical (and humane) answer which is substantiated with appropriate reasoning. Ie number of people on a team, game being played, what is required to win a match, are there several games in a match? knockout style tornamant sounds like a good approach. I agree with Mike. Just show the interviewer how you think and how you will tackle the problem in a colloborative environment 1 I'd give an approximate answer, stating my assumptions. The question asked is not the number of rounds (2 people per game: log base 2, giving approximately 13 rounds with everyone playing at least one game ) - it's the number of games. So, if two people per game, then it's the sum of 5623/2 + 5623/4 + 5623/8 + 5623/16 + ... The limit of this is not something I know off the top of my head, but it's less than 5623. Also, interestingly, you need to account for the original number being odd. That could be accommodated in a number of ways, none of them straightforward. I personally agree with most of you. If you read the posts here, you see all types of answers. Some say "1". Short and simple rules to a simple game. Others have posted all types of formulas and methods to figure out a process. The answers here are all a good example of different minds using different means to find an end. Those different answers are what a good interviewer would be looking for. If the job needs a person that is logical and takes time to plan things out, or perhaps someone that needs to think fast on their feet. That kind of question could come in handy for any kind of interview in my opinion. 1 I think the interviewer is asking you to ask for more information, ask three qualifieng questions to be exact in order to show you have the probing skills to fully understand a customers situation or company problem and have the ability to ask the appropriate questions to or to get the help to solve. Question 1) How many players are allowed per round? Question 2) Is there a time restriction on these rounds? (Daylight or Night as well) Question 3) Are there going to be different classes for the golfers? Are we taking handicaps into consideration? I guess there could be more questions but chances are the interviewer would stop you after the third question. The correct answer is: "I didn't come here to play bulls**t games for 8 hours, you Mac-slinging hipster. Ask me a real question." 5622....................................assuming single elimination 5623 is a prime number. Good luck dividing into even teams. Also, there is no use of the word "minimum" in the original question. This question is a good example of a problem with no absolute answer. If I were to ask this of an interview candidate (which I wouldn't because I think subjective questions are mostly a waste of time for everyone involved), I would look for someone who can: A) Ask questions to pin down a few details. B) Formulate options. C) Suggest options with recommendation and take feedback. D) Execute (pretty hard to demonstrate in the 10 minutes max I'd give this). p.s. I'd hire chapped. Good answer! Show More Responses 'Excuse me, I'm just waiting for excel to open and my math wiz buddy in accounts to pick up to verify my calculation. I'll get back to you in two minutes with the answer.' 'Excuse me, I'm just waiting for excel to open and my math wiz buddy in accounts to pick up to verify my calculation. I'll get back to you in two minutes with the answer.' I would try and be creative and put my suggestions in front of them while I give them a reason for all the options that I choose. For instance, I'd say I would create 5 levels for each game as adding more levels makes the game more challenging and interesting. I wouldn't want to set up too many games as it would require a lot of overhead using up a lot of resources for organizing large number of games. Hence, in each round I would eliminate 20 participants. That would make 100 players getting eliminated after every game. After every 10 games, I would allow all the eliminated contestants to battle it out and 15 can re-enter the game as the eliminated ones would get a chance to observe, learn, refresh and get a second chance... (The interviewer might stop me eventually before it gets too long). Even though my answer was too long, I think I would show them how my logical thinking works. They would see that I am thinking aloud and in the end all that matters is how we approach the problem rather than giving them a vague answer with no reasoning. Oh and I agree with Toasty, I would hire chapped :) I like the way they think. Oh and I agree with Toasty, I would hire chapped :) I like the way they think. i dont know how everybody else thinks butI divided by two with an extra game for when the number is odd and came up with 5627. the question was straight forward, " How many games".... ********************* Keep in mind the position, Nathaniel is right. YOU are organizing the tournament, make a rational decision and describe it. Your answer should be formulated to convey a skill. For example I might suggest something like this: 1 on 1 round robin, 5,623 players, SUM(1+2+3+...+5621+5622) games Quick and simple, shows some knowledge of algorithms but not very practical. The 1st participant plays 5622 others, the 2nd plays 5621, until the 5622nd plays 1 (5623rd participant). Notice you don't add 5623. Participant with the most wins is the champion. Supposed it is a single elimination. should be 5626 games because the first row would be 5623/2 = 2811.5 which means 1 person must be going to the next round to compete therefore we will have 2812 contestants then the second row would be 2812/2 = 1406 the third row would be 1406/2 = 703(odd number which means the one of them is going to the next round without a fight. ect... I believe I would have responded with "Is that how many applicants there are for this job?" Followed by "One game, one victor." Before answering you should read the interview report this question is linked from, where the question is explained in more detail -- """If you had 5,623 participants in a tournament, and each participant had to play games until he/she one or lost, and every game had a winner and loser, how many games would have to be played in order to determine the winner of the tournament""" So it's pretty unambiguous: Participants are individuals; the tournament is single elimination; games involve just two parties (a winner and a loser.) The question doesn't ask about the number of rounds involved, nor about timeframe. Just the sheer number of games. So we're left with an answer of 5622 games (because every game has one and only one loser and 5623 - 1 participants need to lose for there to be a single participant left as the winner, so that's how many games there must be.) Show More Responses Assuming in each game "n" people participate and there is just one winner in a game. If N is the total number of people (in this case 5623), then the approximate number of games would be: log(N)/log(g) -1 After each round, you would have half the number that started the previous round; except if it were an odd number it would he half + 1. So 13 rounds. 2812 1 1406 2 703 3 352 4 176 5 88 6 44 7 22 8 11 9 6 10 3 11 2 12 1 13 It is far simpler than you guys are making it out to be. In ALL single elimination tournaments there is one less game than the number of participants. Because in every game 1 team gets eliminated. And at the end 1 team has to be left standing. This will be a detailed explanation. Since they're asking for a tournament, that means one on one matches, and eliminations of 'participants' or players. With such a large number doing a round robin style tournament would not be very efficient, as every player would have to play every other player, ((N-1)^2)/2 =15,803,442 matches. I would first start to get more details of the tournament. If it were up to me to design the tournament and easily determine the number of matches, I would go with single elimination bracket because since its based on power of 2. Contrary to what what Bob InNorCal did, you dont start halving the at the beginning with 5623, because its not power of 2. You will get to a point where there wont be even numbers, and BYEs will have to be given, it would be unfair to give byes out at the end or middle of the tournament, players would complain that others got BYEs and they didnt. Detailed Explaination: In a single elimination bracket, the brackets end with 1 match between 2 players, then 2 matches and 4 player, and eventually for this tournament, 4096 matches between 8192 players. But since we dont have 8192 players, there will have to be BYEs which wont count as matches. In this case we'll have to use a 8192 single bracket, with the first 4096 players spread every other position then the last 1527 players spread evenly throughout the bracket and the remaining 2569 positions are BYEs (4096 + 1527 + 2569 = 8192). Here are how the rounds look like: A - 1527 matches, (4096 matches was suppose to happen, but 2569 BYEs are no counted) B - 2048 matches, C - 1024 matches, D - 512 matches, E - 256 matches, F - 128 matches, G - 64 matches, H - 32 matches, I - 16 matches, J - 8 matches, K - 4 matches L - 2 matches, M - 1 match From round B-M, its (2^12)-1 = 4095, so with Round A, its 4095+1527=5622. The calculated answer 5622 is one match less than the number of participants. However, just because its easy with single elimination to determine the number of matches, does not mean that it is what they initially asked, conversing with the interviewer for more details of the tournament is important. If the interviewer said it was a double elimination tournament then a player would have to lose twice in the bracket to be eliminated from the tournament. Depending on the number of players and the placement of the BYEs, then calculating the number of matches in a true double elimination maybe difficult. Also in Double Elimination, the winner maybe won by someone without a loss or with 1 loss, the winner without a loss means one less game. it is assumed that the competition is a head to head knockout competition like wimbledon. the only correct answer is 5,622. the quickest and smartest way to get that answer is to see that in a knockout tournament every body loses once and only once, except the winner. in every match, one person loses. therefore the number of matches required equals the number of players minus 1. PaulO, Jordan, madhur, simplebrain and key2success you are all hired! How many games are played? Well all of them of course, how else do you find the winner. It need only one game to find the winner If it is your game you can appoint a winner without playing any games. Then 0 is a possible answer. 1 is also a viable answer, if it is a game of life and death it is possible that no one lives then there are no winners on the first round. Such as a game that on the first round were everybody is exposed to a nuclear blast. Even those exposed to the fall out might be considered losers. A game like chess where you eliminate draw contestant then 1 round to 13 rounds would be required. You could divide by 2 to get the rounds or use logarithms to convert 2**13 which is greater than 5,623 to a log equation such as log(5,623)/log(2). Potentially everybody can loose on the first round because of the draw rule and the person with the bye on the first round can loose because they have no one to play to win. You can change the rules so that infinite rounds are required to determine a winner. One way to do this is to increase the elimination rounds so that it approaches infinity. As this goes on your interviewers glaze over and fall to sleep and when they wake up they decide not to give you the job. This can be poker tournament (as too many players). From 5-7 people - one wins. This can keep number of games to reasonable limit. Depends on how many rounds there are to determine a winner. Logical answer here could be 5623 Show More Responses 5,623 - each person plays, person with the highest score wins. There would be 5613 head-to-head games cosisting of 12 rounds with one team receiving a bye in each round except the fourth round, the tenth round, and, of course, the twelfth round. What kind of tournament? The simple answer is Number of Teams minus ONE. Simplified, a four team bracket plays 3 games. Assuming the tournament is Mortal Kombat everyone knows that earth realm has to win because out realm is evil and evil... Sucks. No games necessary. I would have been startled as well, just reading it. Congrats on keeping your calm! My intuitive answer would have probably been: Game theory - 1 or rather none - when it's a battle to death everyone loses, even the winner (last man standing, howling at the moon). I would have likened it to the company and customer situation - in good company EVERYONE is a winner (win-win scenario). Good luck with your endeavors! Depends on the numbers of players per team. I agree with the very first response. Many of you are perhaps making the assumption that this is a one-on-one tournament such as singles tennis. Isn't it possible the question could refer to a soccer or basketball tournament where there are multiple players on each team? That would certainly bring the number of games to be played down considerably. There is no true answer as the question is very open ended. The interviewer is probably looking at task delegation, management and creativity skills. if each team plays until it loses in one(team)-on-one(team) contests, the answer is ln(5623)/ln(2) Show More Responses It can be just one game. A huge mock battle. A specific numerical answer can be given, but there are multiple ways the tournament can be setup, for example, are there play-in games, byes, etc. I would think the question is being given to a manager to see how they think and process, and then come up with a specific numerical answer, as opposed to just a math problem. 2 One There will be 2 games. The first game is a question: Would you like to play a game? Which is then followed by the second game - one involving thrones. None. Our PC world demands everyone gets a trophy. 1. I think, this question is for a management position. The size of team is given as a too big random number. One cannot control a team of 5627. Divide them in a measure size, e.g size of 10 or 20 (any measureble size). With 10, there will ve 563, which can be further divided into 10, leading to apx 57. that can be futher divided into 10, leaving it to 6 teams. proformance/ goals can be set and can be evaluated later. 2. or do a marathon. 5622 ... if based on elimination between 2. |

### ASIC Verification Engineer at Zoran was asked...

You have 2 pieces of rope, each of which burns from one end to the other in 30 minutes (no matter which end is lit). If different pieces touch, the flame will transfer from one to the other. You cannot assume any rope properties that were not stated. Given only 1 match, can you time 45 minutes? 49 AnswersTake one rope (Rope A), place it down as a circle. Light match and start burning rope A at the tips that are touching. When the rope completely burns out, 15 minutes will have passed (since both ends are burning and being consumed at once). Hold the second rope (Rope B) straight and place one end so that it will immediately catch fire when the two burning points from (Rope A) finally touch and are just about to burn out. Thus 15 minutes on Rope A + 30 minutes on Rope B gives you 45 mins. How about this: Fold the first rope double so the ends touch. Lay it down and lay the second rope so it touches the fold of the first rope. Light the ends of the first rope. After 15 minutes the second rope should ignite. Once second rope finishes burning it is 45 minutes. Same principle as above, I just don't want to sit there for 15 minutes in order to light the second rope.... :-) Make a T. Simple Show More Responses Light both ropes at the same time with the match: ------------* () *---------- || then place the two ropes next to each other with the burning ends opposite each other: this way one of the ropes burns left to right, while the other is burning right to left. ----------* *---------- In 15 min the two burning ends will be next to each other. -----* *----- Great Puzzle, thanks! ** You cannot assume any rope properties that were not stated Burn like this *-------- ===> After 30mins, Rope A finished burning, and both ends of Rope B start burning burn one rope, wait till it gets to the half way point, then you transfer the first one to the second one to initiate the other flame. wait till the end. 45 minutes are up You have 2 pieces of rope, each of which burns from one end to the other in 30 minutes (no matter which end is lit). If different pieces touch, the flame will transfer from one to the other at the point at which the burn rate consumes the first rope to its point of contact with the second rope. The only thing we know about the second rope is that it will burn in 30 minutes if ignited from one end. There is no assurance the second rope will ignite, or burn at the stated rate, if an end is not made to point of contact. do you want to buy saints jerseys,vikings jerseys? depends on what the ropes are made of @eaasy you can assume that the second rope with burn at the same rate if lit from the middle, as the rope burns a set amount of time from either end. If Point A to Point B is the same as Point B to Point A, igniting from the center would cause the flame to finishing burning Point A AND point B at the same time. As for ignition, you have a point. There is no assurance that the first rope does not have a prolonged burn rate at the ends and an accelerated burn rate in the center. Therefore the second rope could have ignited before the first rope finishing burning (at any point before the 30 minute limit) which would make timing 45 minutes improbable. Lay one down, and have the second one touch the first rope perpendicularly at the midpoint. Light the first one, when it gets to the midpoint (15 minutes), the second will start burning. When the second one extinguishing you have 45 minutes. T. Simple, quick, walk away and do 45 minutes' work where you can still see light from the flame. Both ends will finish burning at the same time if environmental conditions are consistent. LAY THE TWO ROPES WHERE THE SECOND ROPE IS TOUCHING ONE END TO THE MIDDLE OF THE FIRST ROPE. IT SHOULD TAKE 15 MINUTES TO START THE SECOND ROPE AND THEN ANOTHER 30 TO COMPLETLY FINISH BURNING SO THIS IS 15+30=45 Show More Responses lay ropes end to end, to make one long length, when first length ignites the end of the second length, touch the last remaining end to it and let the flames meet somewhere in the middle. That way each flame will travel in the correct direction, are considered to be burning end to end, without ambiguously being lighted in the middle and hoping the direction will be as desired.... since it takes 30 minutes end to end, then to ignite both ends of the second rope will draw a 15 minute interval no matter what the burn rate is per divided section, thank you and I will accept $150 K per year and 30 days vacation time yearly as well... I had no idea that rope burning was so lucrative a career field... and I want my own rest room. it all depends on what kind of match you have. They said you have one match (no book or box) so if it's not a strike anywhere match then you're screwed. However, if it is then make the T formation... The vertical rope burns 30m then the horizontal burns both directions for 15. No loops, circles or folding required :-) burn A at the two ends will give you 15 min, and when finish A, then burn B next. Lay the map in a T formation, light two ends of the horizontal rope with the match. when the flames meet in the middle in 15 minutes they will light the second rope which is perpendicular to (and touching) the first rope. That rope will take 30 minutes to burn. Hence, 15 plus 30 = 45 minutes. burn A at the two ends will give you 15 min, and when finish A, then burn B next burn one rope, wait till it gets to the half way point, then you transfer the first one to the second one to initiate the other flame. wait till the end. 45 minutes are up Helpful Answer? Yes | No Lay the two ropes in a "T" shape. Burn the one rope at the bottom end of the "T". It will take 30 mins for the flame to go through first rope, and when it reach the other end, transfering the flame onto the second rope right at the middle with the flame move towards both directions, taking 15 mins to completely burn out. This is a silly riddle.... because we're not given the property that the rope can bend, the best formation for the two ropes is to lay them in the "+" formation that everyone got. However, no one mentioned burning the rope at the intersection of the two ropes, ropes will burn in 15 minutes. Also, there isn't anything saying you can't light the ropes more than once with one match (assuming you have the ability to light the match, as someone already pointed out as a significant problem), in that case, you could burn the ropes up in less than a minute. If the rope can bend, just bundle the ropes up into a ball and light the rope ball on fire... it take 1.3 seconds to burn the ball if you create the most efficient weave... true story, I was there. But of course, if you wanted to make the most efficient use of your time (e.g., if you're lazy), you can just crumple the ropes up together, drop the heap of rope on the ground, and throw the lit match on the pile and be done with riddle (and the ropes... and the match). I agree with a couple people here. In this you cant assume the rope burns uniformly. Therefore loop one rope and put the end of the other so it touches where the ends meet. so you have this C--- light the straight rope, when it burns it'll light the "C" which will burn in half the stated time (15 mins). Just a quick one for all the "T" people, you're wrong... The rope doesn't burn uniformly so you can't measure to choose time. If you could you may as well just cut one of the ropes... Show More Responses Solution: NO YOU CANNOT GUARANTEE 45min. Most likely solution to work: Straight followed by loop. ---O One straight, followed by a loop. Ignite straight first, have it ignite the loop. You ignite the straight, gives you 30 minutes. Loop ignites, both ends may burn at different speeds, but when it finishes it will be 30mn/2. The flame may end anywhere on the loop, not necessarily at the 1/2 way of the rope. Why wouldn't it work: Above, you're assuming the rope burns end to end. If the rope is really non-uniformly burning, you can devise a case where burning on both sides at the same time doesn't make the burn 1/2 the time: For example, the outside burns real fast and the core real slow: no matter where you ignite it, or how many times, it would burn in 30mn. For that case, you could split the rope at their diameter and maybe rig a solution. But likely there can be another counter example that can be built, more and more far fetched. Interviewer will want you to explain the thoughts, non-uniform burn, etc. So this is an opening to check your deductive powers. What's the purpose of such a simple question? To judge how you react and explain yourself? Fold each rope in half & mark them in the middle. Light 1 rope & when it reaches the middle light the other one. When the 2nd rope burns completely you'll be at 45 minutes. no comment Too easy... fold one of the ropes in half end to end with the full rope... viola! There are a couple of answers. It depends how you would interpret the question. "the flame will transfer from one to the other" Assuming no special materials you would have on the ropes. This phrase can be interpreted that THERE CAN ONLY BE ONE FLAME. Thus the flame moves from one to the other and does not multiply i.e you can have more than one rope or section of the rope burning .(If it could the solution is easy-just arrange both ropes end to end into a pentagon shape or do what some people have suggested above). for the 45 mins thing you do the T shape like people above suggested so 15+30 =45. If you assume you HAVE to take 45 mins this is the best way. Assume that an earlier finish is best, the Pentagon would be fast. -When I mean pentagon I mean the 5 pointed star thing you know from the occult.- If there was only one flame which could transfer from one rope to the other without creating multiple flames you would have to ask how fast does the flame transfer and what distance does the flame burn at before being transferred. The reason for this is, if the ropes are lied down next to each other TOUCHING each other then the flame would burn, transfer, burn, transfer etc. this would take 30 mins assuming that there is no time lapse on the transfer(hence my questions above). If you wanted to hit the 45mins like it said in the question just have both ropes lie next to each other but have the second rope start from the middle of the first. So after 15mins the second will burn and the flame from this point the remainder of the first rope(15mins) and the second rope will burn 30 mins. Sorry for the poor spelling . Cheers Take one rope, fold it over so one end touches the other, then cut the rope in half. Place one half of the rope at the end of the second whole rope so their ends are touching. Then light either end for 45 minutes of burn. I can't assume rope properties, but nothing says I can't cut it in half. Fold Rope A in half. Lay it down next to Rope B, which is not folded at all. Light Rope B. Reminds me of some of the stupid questions in the Corvirtus test. I took one recently and felt like a 3rd grader. I'm Schmart, I swer. Make a plus sign the the ropes. Light any one end. 15 mins to get get to center, 30 to burn the other rope. Show More Responses Must be a crew of techies answering this question. The obvious answer is to look at a clock. lay both pieces of rope down so that end of rope A touches the end rope rope B light the end of either rope, after 30min have passed the flame will transfer to the other rope,when the rope is half burn 45 total min will have passed. so yes you can time 45min. 45 minutes is easy. I would rather have an hour of light. Tie the ropes together, making one long rope. Light one end and get 1 hour. The Question is "Given only 1 match, can you time 45 minutes?". Option 1. You have a timing device and are allowed to use it - no prohibition stated in setup or question - of course you can "time 45 min" to the precision of your timing device. Option 2. We know: Ignition can occur at either end. From reaction start to reaction end of each rope takes 30min. We can not assume that the rope burns evenly, can be bent, lit up other than the ends or even transmit the flame to the outside of the rope (Think trapped chemical burn in a tube). Therefore we can NOT build a timing device. Put one rope in a straight line, bend the second rope into an O shape (with both ends touching one end of the first rope), when the first rope reaches its end, 30 minutes will have passed, and ignite the second rope. The second rope, which has both of its ends ignited at the same time, will meet at its center, timing 15 more minutes have passed. -> ///////////O Lay down both ropes evenly side by side. Slide one rope down 1/2 the length of the other then light one of the ends. Make a "T" with the ropes. 1 rope burns in 30 min, that rope is touching the middle of the second rope, and with two equal halfs(30/2) it should burn in 15 mins. ----------- -------------, then push them together First of all, the question is "Given 1 match, can you time 45 mins?"... well you can stand there with a match in your hand and time 45 mins with any stopwatch. Or is the question really can you time 45 mins using that match? Then using the match to create a shadow..... hem hem maybe not. Let assume the question was meant to be "can you burn both ropes in 45 mins?"... well it doesn't say anywhere that the match can only light one rope. I've lit many birthday cakes in my days and I promise that only one match can light a full array of candles. So if the ropes burn in 30 mins. and you light both of them with the one match then yes; the burning of the ropes should be done under 45 minutes. But then again.... maybe the question was "can you burn both ropes in EXACTLY 45 minutes?" Now the real answer I think is that the question need to be more clear :) Light one of the ropes from one side only. when it burns out completely (30 mins) light the second rope from BOTH sides. that will double the rate at which it burns, making it completely burnt out in 15 mins. Total 45 min Show More Responses ***CORRECTION*** didn't realize the "one match only" make a loop and a long rope running out of it (like a key figure) light the loose end of the standing rope. it will burn in 30 min. When it reaches the end it will ignite both sides of the other rope, doubling the rate at which it burns (i.e. it will burn to completion in 15 min only) that's a total of 45 min. Keep the first rope straight, and the two tips of second rope touching one end of first rope. Now lit the other end first rope. So first rope takes 30 min to burn and transmit fire to two ends of second rope which will take 15 min to burn. So total of 30+15= 45 min The answer is simple... Make a sundial with the match and the rope. Can Keep the ropes in this fashion----------》 《--------- And fire dem with opposite side burning. Now when both fire meet it wil be 15 mints...nw both have 15 mints remaining now bur first remain rope which will take 15 mints more and den burn second remaining rope which will take another 15 mints..so total 45 mints..isn't it simple ..;) The question does not state that the items in the question are required to provide the answer so... Take note of your start time. Take the first length of rope and lay it next to the match. Then, carefully inspect the second length of rope for any defects. If none are found, or even if there are defects present, place the rope on the ground in a straight line facing north to south. Place the first length of rope, which is tired to the match, approximately 5 feet to the north of the second length of rope. **Warning: This step requires quick action on your part** While the match is burning, tie the first length of rope to the match. Take the second length of rope and touch the north end to the match while it is still lit. Grasp the second length of rope in your left hand and spin 360 degrees counter clockwise and throw it as far as you can. Now go have a beer and keep an eye on your watch to see when the 45 minute timeframe has finished. |

### Software Developer Position at RockYou was asked...

Given 5 pirates on a ship, they need to distribute a pot of gold that has 100 gold pieces inside of it. The first pirate must make a proposal of how the gold will be distributed. If he receives over 50% votes from the remaining pirates, then his proposal will be accepted and the gold will be distributed. If he receives less then 50% support, then he will be thrown off the ship and die. 42 AnswersThe answer is for the first pirate to offer the 3rd and 5th pirates 1 gold each, and then take the remaining gold for himself. Otherwise the 3rd and 5th will probably not receive any gold. this is an extremely subjective question. first the nature of the pirates must be examined. if this is truly a team, then of course each pirate should receive 20 pieces of gold. however, if there is a division of labor that affords certain pirates greater responsibility then we are looking at a vertically stratified solution. in this case those at the top, the CEO's of the pirates, must be given more of the booty. if there is no stratification, but the nature of the pirates is individualistic and greedy, i would assume divide the gold into pirates 2 and 4 get 25 + you get 20 + pirates 3 and 5 each get 15. The first answer is right. You need to think that the pirates are rational and greedy for the most they can get. Then you need to consider what would happen with two pirates and take it from there. Show More Responses i disagree with the first answer completely. his proposal needs to have over 50% votes by the remaining pirates, not including himself. this means 3 out of 4 votes. if he proposes taking 98 pieces and the 3rd and 5th take 1 each, there's probably no way any of the 4 will vote for that proposal. since he needs 3 out of 4 votes excluding himself, that one nay vote can get snubbed altogether. assuming that the pirates want to maximize as much as possible, they will not mind the fifth pirate not receiving ANY gold. i suggest that the first pirate make one of the following proposals: - first pirate receives 1 gold so that the other 3 equally receive 33 gold pieces. the nay vote pirate will get 0. this carries the least risk of him getting kicked off. - first pirate receives 25 pieces as well as three other pirates. the nay vote pirate will get 0. the 3 other pirates voting for the proposal might view this as the most equitable solution among the four with one guy losing out. i disagree with the first answer completely. his proposal needs to have over 50% votes by the remaining pirates, not including himself. this means 3 out of 4 votes. if he proposes taking 98 pieces and the 3rd and 5th take 1 each, there's probably no way any of the 4 will vote for that proposal. since he needs 3 out of 4 votes excluding himself, that one nay vote can get snubbed altogether. assuming that the pirates want to maximize as much as possible, they will not mind the fifth pirate not receiving ANY gold. i suggest that the first pirate make one of the following proposals: - first pirate receives 1 gold so that the other 3 equally receive 33 gold pieces. the nay vote pirate will get 0. this carries the least risk of him getting kicked off. - first pirate receives 25 pieces as well as three other pirates. the nay vote pirate will get 0. the 3 other pirates voting for the proposal might view this as the most equitable solution among the four with one guy losing out. i disagree with the first answer completely. his proposal needs to have over 50% votes by the remaining pirates, not including himself. this means 3 out of 4 votes. if he proposes taking 98 pieces and the 3rd and 5th take 1 each, there's probably no way any of the 4 will vote for that proposal. since he needs 3 out of 4 votes excluding himself, that one nay vote can get snubbed altogether. assuming that the pirates want to maximize as much as possible, they will not mind the fifth pirate not receiving ANY gold. i suggest that the first pirate make one of the following proposals: - first pirate receives 1 gold so that the other 3 equally receive 33 gold pieces. the nay vote pirate will get 0. this carries the least risk of him getting kicked off. - first pirate receives 25 pieces as well as three other pirates. the nay vote pirate will get 0. the 3 other pirates voting for the proposal might view this as the most equitable solution among the four with one guy losing out. He needs to shoot the ring leader(dominant) of the remaining 4 pirates and re-negotiate after reloading. There isn't an optimal solution for the first pirate. The first pirate can't come up with a solution that will give 2 other pirates a maximum of the gold. The other pirates will always vote no unless the first pirate gives one of them all 100 pieces, since it's always in their best interests to dump the guy overboard and split it amongst less people. It's the wrong question. The question correctly stated is as follows: (credit to vorg.ca) Five buccaneers have obtained 100 doubloons and have to divide up the loot. The buccaneers are all extremely intelligent, treacherous and selfish (especially the captain). The captain always proposes a distribution of the loot. All buccaneers vote on the proposal, and if half the crew or more go "Aye", the loot is divided as proposed, as no buccaneer would be willing to take on the captain without superior force on their side. If the captain fails to obtain support of at least half his crew (which includes himself), he faces a mutiny, and all buccaneers will turn against him and make him walk the plank. The buccaneers start over again with the next senior buccaneer as captain. What is the maximum number of doubloons the captain can keep without risking his life? 20 pieces. The captain should divide the pie equally 5 ways (20 pieces). Then explain to the four pirates that anyone who does not agree to this fair deal of equal distribution will receive nothing, and that person's share will be retained by the captain alone. No one would want the captain to get their share. Everyone would think the deal fair. And therefore the captain's life would not be at risk at all. Be bold, be treacherous, be past tense: I took Pirate 2 and Pirate 3 aside. I told them, "We will split the gold evenly, three ways, between us. We three can overpower Pirate 4 and Pirate 5, so they do not receive any gold." Then I took Pirate 4 and Pirate 5 aside. I told them, "We will split the gold evenly, three ways, between us. We three can overpower Pirate 2 and Pirate 3, so they do not receive any gold." The vote was 100%, and I got away with all the gold, since each of the other pirates killed each other for being doublecrossed. Since I'm telling the story, it's clear I survived. Splitting the gold amongst 3 of the 5 pirates (1st pirate included) gets 50% of the remain pirate vote. In this way, the pirates get the most gold and there is a majority to vote against the first pirates death. Navy Seals kill all the pirates and return the gold to the rightful owner. Show More Responses The leader can keep 98 of the gold coins and give 1 to the 2nd ranked and 1 to the 4th ranked pirates. Let's assume 1st that they are so selfish that they care more about the money than each other's lives, and 2nd, that they follow this 50% rule without question. The lowest ranking pirate, number 5, has absolutely no reason to support any other pirates, because he knows that if all the other pirates walk the plank he gets 100 pieces. Pirate number 4 knows that if he's left with pirate 5, pirate 5 will demand all the booty or vote against the proposal to kill 4 and receive it anyway. Pirate 3 recognizes pirate 4's predicament and would only have to offer him 1 piece of gold so that 4 would come out better than being stuck with making the decision and losing everything. His support would provide 3 with a majority. If it came down to pirate 3's decision, he would have 99 pieces, 4 would have 1 and 5 would have 0. If the second ranked pirate, pirate 2, was faced with negotiating, he would need the support of 2 additional constituents. 5 will always vote against him, and 3 recognizes that he can make 99 pieces of booty if he's in control. In order to live, pirate 2 would have to offer pirate 3 99 pieces and pirate 4 1 piece, leaving him with nothing. Pirate number 1 similarly recognizes the predicament of pirate 2. Pirate 1 only needs two other supporters. That's easy. Better that pirate 2 receives his life and even one piece of gold than nothing. Pirate one offers him 1 piece of gold. Similarly, pirate 4 knows that he can get 1 piece of gold and his life, so pirate 1 offers him 1 piece of gold and has his support. After giving pirate 2 and pirate 4 one piece of gold each, he has their support and can take the remaining 98 pieces for himself. QED! Yeah baby! The rationale set forth by Marketing and Information Systems Major is well-explained and thought out, but with one fatal error (i.e. my user name). The interviewee is correct. Suppose that pirates are named by letters, with the most junior pirate in each scenario being Pirate A. I'll list the pirates in order of seniority for each case: In a two-pirate case (Captain, Pirate A), the captain always keeps the booty. Pirate A has no leverage whatsoever, since he'll never have superior force to remove the captain. In a three-pirate case (Captain, Pirate B, Pirate A), the captain only needs one vote. Pirate B wants to get rid of the Captain so he can be in the advantageous two-pirate case. Pirate A wants to AVOID that, so the Captain easily buys Pirate A's vote with one gold coin -- the status quo is maintained, and Pirate B gets shafted. In a four-pirate case (Captain, Pirate C, Pirate B, Pirate A), the captain still only needs one vote (a tie means no superior force, which means the status quo is maintained and the captain wins). We pose our standard question: "If the captain loses the vote, who gets shafted?" -- well, if the captain loses, it's a three-pirate case, which means Pirate B gets shafted. So the captain easily buys Pirate B's vote with one gold coin, and the status quo is maintained. Result: Pirates A and C got shafted. In the desired five-pirate case (captain, Pirate D, Pirate C, Pirate B, Pirate A), the captain needs TWO votes to avoid losing power. So we ask ourselves: "if the captain loses the vote, who gets shafted?" -- Pirates A and C (as determined above, in the four-pirate case). Therefore, to maintain the status quo, the captain proposes one gold coin to Pirates A and C each, and keeps 98% of the booty for himself. The downfall of these pirates is their inability to think laterally or deeply e.g. it's a machine question, not a human question. Subjective variables such as selflessness and morality would make these pirates much less predictable, forcing the captain to appease each and every one of them to the best of his ability, rather than knowing exactly whose vote to buy and at what price. by "deeply" i meant creatively, and by "e.g." i meant "i.e."!! edits would be awesome. Given that the first pirate needs the majority of the remaining vote (3/4) pirates. Then, First Pirate - 25g Crew Member 2 - 25g Crew Member 3 - 25g Crew Member 4 - 25g Crew Member 5 - 0g My logic behind this is simple. In order for their greed not to be outweighed by their survival the 4 pirates can share the booty equally with the 5th pirate as an example of the position they would find themselves in. 5th Pirate gets thrown of the ship and dies. It could stop here or they could revote, If they revote then, First Pirate - 33.3g Second Pirate - 33.3g Third Pirate - 33.3g Fourth Pirate - 0g Rinse and repeat until two pirates left sharing the loot 50g each. Wait, read the clue carefully. Let's say I'm the captain, and my pirates are 'greedy'. Option #1: I give myself and 4 pirates 20 gold each. That's good, right? Wrong. The pirates are 'greedy', and the 4 pirates will STILL vote to throw me overboard, because that would increase their 'take' to 25 Gold each, since I no longer get any. In order for me to WIN, I need to provide them with MORE than 25 Gold each, because that's what they will get for voting me off. Therefore: I keep 22 Gold, and I give pirates 1,2,3 each 26 GOLD. That means, if they vote me off, they will only get 25 Gold, and 26 is more than 25. Thus, the maximum I can keep is 22 Gold. BUT, if it only takes 2 Votes (i.e, my vote counts), then I keep 34 Gold, and give pirate 2 and 3 33 Gold each. Thus, my vote + 2 pirates >50% of the votes. Pirates 3,4 get zero. if they're going to kill you if you can't get 2 guys to back you up, then they can just as easily all four decide to kill you and then the remaining four are in the same quandry, but with only four shares. keep recursing until there is only one guy with all the gold. your only chance is to give them all the gold in the hope that they will deign to let you live, then kill them while they sleep and take it back. This problem really has no solution to it - as it clearly says the one who is proposing distribution doesn't get to vote! figure this: the lead pirate proposes a solution (98 for himself, 1/1/0/0 for others; or any other option) - but he doesn't get to vote. The others can always call this an unfair division and throw the helpless pirate out - as he doesn't have any say. Even if they decide to divide it as 20 coins each, the others can still throw the first pirate and maximise their share by 25% each - this can go on until the youngest/last pirate walks out with all the money. therefore this is an impractical situation. However, the whole situation changes if you allow the pirate proposing the distribution to vote!!! Then the solution, as proposed by some one above, of a distribution being 98/1/1/0/0 will eventually be accepted. Search for the pirate game on Wikipedia, the question is a straight lift of that puzzle - except that someone decided to change the problem by making the lead pirate non-voting.....and that will always make this problem non-solvable. PS: @ mktg and Systems major: Baby, you forgot to read the problem correctly and just googled it up!!! OK, so within the parameters as outlined, and assuming that this problem is recursive (after the first pirate doesn't get enough votes, he's killed, and they're faced with a 4-pirate situation), let's look at it thusly: They're all greedy, and they all know that the best way is to kill everyone else and grab all of the loot. However, to do this, they _must_ be the "lowest pirate" on the pole (the last one to be given the chance of dividing the loot). If this "pecking order" is fixed (everyone knows exactly how they stand), it is different from if it is random. Let's look at both. 5-Pirates, fixed order: In this case, then the proposal outlined by Gus and the others that results in Pirate 5 getting 98 coins, and 4 and 2 getting 1 coin each works out best. 5-Pirates, random order: This is different, as the problem then becomes how the order is established after each pirate gets killed. Everybody wants to be the Last Pirate Standing (tm) (Fox, call me for show marketing rights), but as the first one gets killed, there is increasing odds that they will be chosen next, and not be the LPS. Unfortunately, in the question as posted (5 nameless, rank-less pirates) we don't know how pirate 5 got chosen to choose, and we don't know how pirate 4 will be chosen after pirate 5's demise. In this case, Pirate 5's best play would be to give two pirates 34 gold (one more than 33, and him take 32) if only two votes are needed, or give three pirates 26 gold (one more than 25, and him take 22) if a majority vote is needed, and hope that they would see this as fitting, instead of being the next sap in the position of making a 4-way split or his life. As stated the answer is: 25 gold pieces should go to any three pirates, with the leader keeping the remaining 25 for himself. Note - Gus' solution is incorrect because he assumes that the leader can vote on his own proposal. The leader can't. Also - as some others have pointed out, this probably isn't the right question. The question with a "succession plan" has a more interesting answer. Here is the detailed reasoning: So - I start by assuming that for all pirates, its infinitely more important to be alive than to get any gold, but if they are alive, they want as much gold as possible. The pirates, other than the leader are "unorganized", and all things being equal, they would rather have as many pirates around as possible. These are risk adverse pirates :) Assume there was one pirate: the best proposal - take all the gold for himself, which would definitely pass. If there were two pirates, unless the leader proposes to give all of the gold to other pirate, his companion will vote against it, and take all of the gold. If there are three pirates: if the other two pirates have a 50% of getting nothing and a 50% chance of getting 100 gold. So the expected value for both them is 50 gold pieces. He needs two votes to stay alive, so offering either of them less than 50 will assure losing a vote, and thus his life. Therefore, the leader proposes 50 gold to each of the other pirates, and stays alive. If there are four pirates: The remaining pirates have a 33% chance of getting nothing, and a 66% chance of getting 50 gold pieces if they reject the leader's offer. Their expected value is 33 gold pieces each. Offering any two of them 33 gold pieces, and with the leader keeping 34 is a proposal that should pass. If there are five pirates: for the four remaining pirates, they have a 25% chance of getting 34 gold pieces, a 50% chance of getting 33, and a 25% chance of getting nothing if they reject the leader's proposal. Their expected value is: 25 gold pieces. Since three votes are needed, 25 gold pieces should go to any three pirates, with the leader keeping the remaining 25 for himself. Show More Responses If I were the 1st pirate, I'd consider that goal #1 is to stay alive - my life is worth more than all the gold. So I'd propose that each of the other four pirates would receive 21 pieces of gold and I'd keep 16... and my life. Odds are that the other pirates would find this acceptable, and they may even keep me around to make the first proposal again next time. It's a win-win. We all keep our lives and get more gold than we had before. I can't speak for other pirates, but that's what I'd do. The proposal has to be accepted by two of the four other pirates. The only way the first pirate can do this is interview each of the other pirates individually and ask what they think is fair. His objective is to find two that are similar enough that he can modify the two into one plan. After mofifying the two plans into one plan he then goes back and asks these two individually again if the modified plan is acceptable. If he can get these two to accept the modified plan then he presents it. It doesn't matter what the other two pirates who were left out think because he has the two votes he needs. There's a pot of gold no one's seeing. The end game is that the last two will share 50 gold pieces each (no majority to mutiny). So pick two friends, offer them the 100 gold pieces between them, and hope they give you some afterward (but don't bet on it). Keep the gold pot and the friends. You lose two votes from those disenfranchised, but you and two friends hold majority might. Here's my thought about this. 100 gold to be distributed to 5 pirates The first pirate proposes how it will be distributed. He has to get 3 out of 4 votes in order to stay alive, otherwise he will be thrown out of ship and die. Let's say pirates are in nature greedy. Second/third/fourth/fifth pirate will rather kill the first pirate to accumulate more share of gold. If the first pirate proposes anything that doesn't let him get even a gold, his proposal might be accepted and he will remain alive. Ofcourse it might not be what will happen. The other pirates kill the first pirate and they quarrel over the pot of gold. The last-man-standing gets everything. Or they all die and no-one gets anything. The answer is 97. Start with three pirates. Attach the gold to a life preserver and throw it overboard . If they are so greedy they will all dive after it. You sail away with the ship and sell it for much more than 100 pieces of gold. First, you must realize this is not just a logic question with one right answer, but a way for an employer to probe you thinking process as you talk out loud. So if you make stupid assumptions like “I’m the captain so they will let me have more” or “I will just kill them later” or “I would strike a side deal”, then you will be looked at as a dodger or lazy or scared to address the question, so that crap is out in an interview. You might get points with this one good assumption: “It looks like the question is incomplete, I assume that the voting rounds continue until an offer is accepted or only one pirate is left.” Facts: in round 1 the offeror needs 3 of 4 votes for a majority. In round 2 he needs 2 of 3, in round 3 he needs 2 of 2 and in round 4 he needs 1 of 1. (So now you are showing the interviewer you are thinking ahead before rushing off trying to give the answer). So the offeror in the first round wants to maximize his gold and his chance of living. So he makes this offer. 33 Gold to each of 3 voters and 1 for himself. He explains why this is the best they can hope for as such. In the final round, the 1 voter either gets 100 pieces of declines the offer, kills the pirate and takes 100 anyway. He can even legally decline the offer of 100, kill the pirate and still take 100 pieces. Now you may think this is good, but the odds of one of the 4 of you being alive and being the voter is 1 in 4 or 25% (see mister interviewer, I can to simple math). So you have a 25% chance of 100 pieces, or 25 on average, so 33 and guaranteed life now is a better deal, in fact you should be happy if I offered you 26. But I want to take just one, so in the next round, the offeror will have to take 1 or less or face certain death, because he saw me die for just 1. In the next round, that means the 2 winning voters will want 50 pieces each. But they only have a 50% chance of being 2 of the 4 people being offered gold. That means they have a 50% chance of getting 50 pieces, on average, they get 25, again less than 33. If they want to try to make it to round 3, there will be 1 offeror and he will have to get both votes for a majority to live, so again he will have to be willing to give 50 to each. From round 1, the 4 have a 50% chance of being a voter now and a 50% chance of being dead or getting 0 and living. If they get 50 pieces, then 50% of that is 25. Still less than 33. Also, the offeror can argue that if they don’t accept his offer, then one of them will die and/or get 0 in next round, the other will get 100, but at this point on average would get only 50. So he might be willing to offer each much less then 50 to guarantee they live, so now they are worse off. In no average case are they better off than taking your 26-33 piece offer and the certainty of life. (Now, if I am the first offeror, I will probably max out their offer at 33 so I maximize my chance to live and fight another day). Or you just pull out your light saber and kill the other 4. You need to look at the question from the end first. As each pirate is thrown off the ship, there are fewer pirates to split the gold up with. At the end there will be 1 pirate who gets all 100 pieces of gold. Pirate 5 1 pirate 100 With two pirates, the situation looks like this: Pirate 4 Pirate 5 2 pirates 0 100 1 pirate 100 Pirate 5 has no reason to accept any offer other than all the gold, since if he rejects Pirate 4’s offer, he will get all the gold, anyway. With three pirates: Pirate 3 Pirate 4 Pirate 5 3 pirates 99 1 0 2 pirates 0 100 1 pirate 100 With 1 or 2 pirates, Pirate 5 has all the power, but with three pirates, 1 piece of gold for Pirate 4 is better than any of the other conditions. With four pirates: Pirate 2 Pirate 3 Pirate 4 Pirate 5 4 pirates 97 0 2 1 3 pirates 99 1 0 2 pirates 0 100 1 pirate 100 With four pirates, Pirate 4 and 5 get a better deal than with 3 pirates. With five pirates: Pirate 1 Pirate 2 Pirate Pirate 4 Pirate 5 5 pirates 97 0 1 0 2 4 pirates 97 0 2 1 3 pirates 99 1 0 2 pirates 0 100 1 pirate 100 Pirate 3 and 5 get a better deal than with 4 pirates. I have just a few things to add that seem logical in order to know how to determine the answer. The most important thing to know is whether they are distributing the gold while at sea or near land (or in port). If they are at sea there is a far greater likelihood that the captain would survive regardless of the distribution, since it takes several people to man a ship. If they are near land, the answer can only be determined by knowing the personalities of the crew and how much fear or respect the captain commands. The more fearsome the captain is, the less likelihood of a mutiny regardless of the division as long as each of the subordinates received an equitable portion and the captains share was not overly large. The idea of 'friends' among pirates is ludicrous- pirates by nature form alliances merely for numbers, and are by defination treacherous. The idea of trying to solve the problem mathmatically is interesting but unsubstantiated as the outcome of gold division vs staying alive would invariably be determined by the variable factors I outlined above. By solving the problem through manipulating the pirates desire to be the only one left alive, there is an underlying assumption that only one pirate is necessary to sail a large vessal at sea, which is not the case, and even pirates know that. you find the solution by starting from the opposite end. Start with the scenario where only pirate D and E remains alive. Then D will keep everything to himself. Knowing this (if C was alive) he would offer just one gold coin to E (since he knows what happens if they choose to kill C - then E gets nothing). Continue to the point where A is still alive and you'll find: A=98, C:1, E:1 Show More Responses The question should also be that: if the top ranked pirate dies, then the whole process is repeated for the 4 remaining pirates, and so on: if the 2nd ranked pirate dies, it is repeated for the 3 remaining pirates... and so forth... And the answer should be that if all pirates are strictly purely logically and think for himself only, then the top pirate will get 98 coins. This question seems to suggest 2 things: 1) Since the top ranked pirate can get the most gold coins, it justifies why the top person in a company get most of the money and the fraction of the fraction is left for the people underneath. 2) Since it assumes that people underneath will not team up, maybe that's why in some companies, it is the benefit of the top for the people underneath not to be in good relationship, so that it mimics the situation above, so that the top person can get most of the gold coins. also note that if makes a difference whether if 50% of the vote is established, whether the top pirate die or whether the proposal is accepted. > 2) Since it assumes that people underneath will not team up, maybe that's why in some companies, it is the benefit of the top for the people underneath not to be in good relationship, so that it mimics the situation above, so that the top person can get most of the gold coins. so those companies will actually want to foster a bad relationship between people underneath. And will that company want to hire "good guys" for the company? No, because the good people are good with each other and can team up. If there are many many bad guys, then they will be all greedy and hate each other and think for themselves only and not team up. Therefore, the company may want to hire bad guys instead of good guys. this is a trick question. if the point is to guarantee that he stay alive, he needs to make 3 pirates as happy as possible. the only way to do that is to split the entire share evenly between them. this means excluding one pirate AND HIMSELF. Assume you are the pirate who distribute the gold, you just put the gold to a heap one by one and let the rest pirate to decide when to stop picking, the first person who says 'stop' will get the whole golds in this heap and the others must distribute the other golds. "Anyone who's with me and votes for my proposal gets an equal share of gold. Vote against me, and you get nothing while the rest of us gets an even more equal share of the booty." I was once faced with this very same dillemma...I ended up splitting the gold between three of the other pirates, which got me the vote I needed. Yargh, but then me and me accomplice, the man without any gold, we shivved all the rest and threw the bodies overboard, each claiming 50 gold, yar! Are you joking? Pirates aren't fair! One pirate cheats all the others and splits with all the booty AND your women... They're pirates for chrissake! The answer is 25. If they split it 5 ways, then its 20 each. If he needs 3 votes, offer each of them 25 and nothing to the last guy, then they will approve, since 25 is more than 20 (even split). |

A frog is at the bottom of a 30 meter well. Each day he summons enough energy for one 3 meter leap up the well. Exhausted, he then hangs there for the rest of the day. At night, while he is asleep, he slips 2 meters backwards. How many days does it take him to escape from the well? 49 Answerstry to answer this question as seriously as u can 28 I agree -- it's 28...because on that morning, he'll be at 27 metres and he can jump to the top in one bound. Show More Responses Answer: 28 Each day he makes it up another meter, and then on the twenty seventh day he can leap three meters and climb out. It's 29 - on the 28th day he can leap 3 meters and hang at the top (but he can't climb higher & out), and on the 29th day he'll leap and be out of the well at 31 meters. 27 At day 0, he jumps to 3m. At day 27, he jumps to 30m and gets out. 28. Each night he ends up/starts the next morning at the number of days he's been there (first night, he's at 1 foot, 2nd night he's at two feet). Hence, on the 28th day he jumps 3 feet to 30 feet. 28 days. At start of day 27, he jumps 3m to reach the top of the 30m well but has no energy left to climb out. At start of day 28, he jumps another 3m and entirely out of the well. Never....the frog would be dead by day 10 since nothing to eat or drink. 28 Saying 28 is too easy. What about the external (1) and internal factors (2): (1) there might be a heavy rain during the first night and the frog can easily float up or, ..., drown, at all; (2) the frog may decide it's sunday - let's have a rest and spare the energy for a bigger jump on the next day... 27 days Day 1 - It jumps 3 meters. 0 + 3 = 3. Then falls back 2 at night. 3 - 2 = 1 Day 2 - It jumps 3 meters. 1 + 3 = 4. Then falls back 2 at night. 4 - 2 = 2. ... Day 26 - It jumps 3 meters. 26 + 3 = 29. Then falls back 2 at night. 29 - 2 = 27. Day 27 - It jumps 3 meters. 27 + 3 = 30 This question is ambiguous whether if the frog is able to get out when it reaches the top or if it needs to exceed 30 meters to climb out. Assuming it doesn't die of starvation, the answer is 28 days.* start of day 1 (0 days elapsed): 0m --> 3m (then falls back 2m by start of day 2) start of day 2 (1 day elapsed): 1m --> 4m start of day 3 (2 days elapsed): 2m --> 5m ... start of day 28 (27 days elapsed): 27m --> 30m start of day 29 (28 days elapsed): 28m --> 31m In other words, 28 days will have elapsed before the frog can jump to a height exceeding 30m.* * This answer assumes the frog is not able to walk away after it hits 30m. I would assume it has no energy left to climb out based on the problem description. If the questioner disagrees with this assumption, then the answer is 27 days. Show More Responses 28 27 ..... he will jump 3 meters this day to get out!!! The math certainly says 27, assuming he only needs to get to 30m to actually get out. its easy to forget that, as pointed out by Paul, he can jump at the beginning of the day, therefore he can reach 3 meters in 0 days. I like the out-of-the-box notions presented by HB and nic. Maybe croaking could get him some help from someone. Maybe he could get up in a well bucket. Why does he want to leave? -- maybe he has everything he needs there and is safe from predators. Why does he slip down? Can he stop that? I wonder what they're looking for in a question like that. I wonder if it really helps them choose good candidates. I wonder who's going to bother reading this. No math necessary. Frog is dead after a few days. 27!! as he will be out on the same day. it will be 28 if he spends the night as well. and c'mon, frog is not based on a binary system, that he wont have enough energy after the last 3 meter, he sure will be motivated enough to take the 3.000001 meteres on the last day to get out of the damn well. 27 days It is 28 assuming reaching 30 ft gets him out of the well, people saying 27 are making the error of assuming there is a day zero, when counting days as with years there is no 0. 28. 27 days to get to go to sleep on level 27. Next day outa da hole. Most frogs have to surface for air. After a short amount of time they will die without air unless they are in aerated water and can absorb through skin. So ask what species is the frog. Day 1: 0 + 3 = 3 - 2 = 1, D2: 1 + 3 = 4 -2 = 2, D3: 2 +3 = 5 - 2 = 3....D28: 27 + 3 = 30 -2 = 28, D29: 28 + 3 = Eaten by the bird that has been waiting for him.... Show More Responses bllshit If Mr. Frog manages to make it up the wall another meter everyday then, on the 27th day, he can leap three meters and climb out, the answer would be 28 days... 28 days. As the frog slips 2 meters down every night by the 27th day he has climbed 27 meters. On 28th, the frog will start from the point of 27m which means start climbing 3 meters foward and this way he reaches his 30m to get out. 28days NB - he does 3m/day, but the result in the next morning b4 his next jump is 1m jump the previous day In the morning of day 26 b4 he jump, he has 5m left...meaning he has done 25m for 25days. On day 26, he jumps 3m, leaving him wit 2m to go but cos he sinks 2m overnight, the4 his resulting meters to go is 4m On day 27, he jumps 3m and left with 1m but sinking 2m more means the resulting meters to go is 3m On day 28, he complete his 30m and walk out from the well victorious provided no predator in the well and he didnt die of starvation 28 days... kermit the frog? How much water is in the well? Frogs need water to survive. What about food? 27th day How did the frog get in the well in the first place? What is motivating him to get up? How does he know he can get out? If the frog slips two meters every night for 27 nights he will be very sad and wont try anymore so he will never get out. Wait....I am this frog! x = number of days A = 30 meters x+2 = A x + 2 = 30 x=28 Show More Responses Thirty days as he is only moving one meter a day. What kind of Frog is it? Is the well full of Water? My first thought is that the frog would not survive, Food and air seem the best bet for Frog-a-cide. Of course if the question is mathematical only in nature then you would have to follow the logic above x=number of days y=30 meters x+2=y x+2=30 x=28 Hey guys ... Its simple don't break your head.... 30 feet well OK 1 day 3 feet jump and sleeping and falling down to 2 feet.. So the frog can only climb up 1 feet per day... so on 26th day it was in 26 th feet and jumped and it reached to 29th feet and sleeping and falling down to 2 feet down.. so on 27th day it was in 27th feet jumped and it reached to 30 feet and went out of the well.. bec after reaching the 30th feet why the hell does the frog gonna sleep again. So it took 27 days for the frog to come out of the 30 feet well. Question created by me... so answered it....lolzzzzzzzzzzz Answer: Day 28 Day 1 - It jumps 3 meters. 0 + 3 = 3. Then falls back 2 at night. 3 - 2 = 1 Day 2 - It jumps 3 meters. 1 + 3 = 4. Then falls back 2 at night. 4 - 2 = 2. ... Day 26 - It jumps 3 meters. 25 + 3 = 28. Then falls back 2 at night. 28 - 2 = 26. Day 27 - It jumps 3 meters. 26 + 3 = 29 Then falls back 2 at night. 29 - 2 = 27. Day 28 - It jumps 3 meters. 27 + 3 = 30 Note: Assume after the first leap that his hind legs are exactly three meters up the well. His hind legs must clear the well for him to escape. Answer: Day 29 Remember that on Day 1 the frog ends at 1 meter, Day 2 the frog ends at 2 meters, ... So on Day 27, the frog end at 27 meters. On Day 28, the frog goes up to 30 meters, then back down to 28 meters. On Day 29 the frog finally makes it to 31 meters (out of the well). This will help if you are still not convinced: int height = 30; int curPos = 0; int days = 0; while(curPosheight){ break; } curPos -=2; if(curPos>height){ break; } } System.out.println(days); } 28 ITS ONLY 10 DAYS. Because, if he waits 10 days, he will summon the strength to jump 30 meters in one jump to the top of the well. Ya'll can't think outside the box... Cool 28 28 Show More Responses I know this isn't the right answer but if u think VERY VERY logically, well, he doesn't. 28 30 days 39 Day 1 -> Total distance Covered = 3-2 = 1m Day 27 -> 1*27 = 27 Day 28 -> 27+3 = 30 and the frog and he escapes 28 will be the final answer |

### Data Scientist at Facebook was asked...

You're about to get on a plane to Seattle. You want to know if you should bring an umbrella. You call 3 random friends of yours who live there and ask each independently if it's raining. Each of your friends has a 2/3 chance of telling you the truth and a 1/3 chance of messing with you by lying. All 3 friends tell you that "Yes" it is raining. What is the probability that it's actually raining in Seattle? 33 AnswersBayesian stats: you should estimate the prior probability that it's raining on any given day in Seattle. If you mention this or ask the interviewer will tell you to use 25%. Then it's straight-forward: P(raining | Yes,Yes,Yes) = Prior(raining) * P(Yes,Yes,Yes | raining) / P(Yes, Yes, Yes) P(Yes,Yes,Yes) = P(raining) * P(Yes,Yes,Yes | raining) + P(not-raining) * P(Yes,Yes,Yes | not-raining) = 0.25*(2/3)^3 + 0.75*(1/3)^3 = 0.25*(8/27) + 0.75*(1/27) P(raining | Yes,Yes,Yes) = 0.25*(8/27) / ( 0.25*8/27 + 0.75*1/27 ) **Bonus points if you notice that you don't need a calculator since all the 27's cancel out and you can multiply top and bottom by 4. P(training | Yes,Yes,Yes) = 8 / ( 8 + 3 ) = 8/11 But honestly, you're going to Seattle, so the answer should always be: "YES, I'm bringing an umbrella!" (yeah yeah, unless your friends mess with you ALL the time ;) I thought about this a little differently from a non-bayes perspective. It's raining if any ONE of the friends is telling the truth, because if they are telling the truth then it is raining. If all of them are lieing, then it isn't raining because they told you that it was raining. So what you want is the probability that any one person is telling the truth. Which is simply 1-Pr(all lie) = 26/27 Anyone let me know if I'm wrong here! Here's another perspective on how to answer a question like this: Bring an umbrella. It's Seattle - if it's not raining right now, it probably will be by the time you get there. Show More Responses I flagged Nub data scientist's answer as useful, because it shows an interesting flaw in reasoning. The 3 random variables are not to be treated as intrinsically independent. Only conditioned on the truth (raining/not raining) are they independent. Isn't the answer 2/3. The key thing is that they are ALL saying "Yes". You can't have all 3 says yes and have some people lying and some people telling the truth. It either is raining or it isn't. Not both. They either are all lying or all telling the truth. Since they are all in agreement (all lying or all truthful), they are essentially voting as one person. What is the probability that one person is telling the truth? 2/3 Answer from a frequentist perspective: Suppose there was one person. P(YES|raining) is twice (2/3 / 1/3) as likely as P(LIE|notraining), so the P(raining) is 2/3. If instead n people all say YES, then they are either all telling the truth, or all lying. The outcome that they are all telling the truth is (2/3)^n / (1/3)^n = 2^n as likely as the outcome that they are not. Thus P(ALL YES | raining) = 2^n / (2^n + 1) = 8/9 for n=3 Notice that this corresponds exactly the bayesian answer when prior(raining) = 1/2. I'm not sure why it's not just as simple as this: All three friends say it is raining. Each friend has prob. 1/3 of lying. Since the friends all say the same thing, they are either all telling the truth or all lying. The question asks what is the probability that it is raining. This is equivalent to asking, what is the probability that all three friends are telling the truth. And that is equivalent to asking, what is the probability that not one of them is lying. Since the the friends were asked independently, this should equal 1 - (1/3 * 1/3 * 1/3) = 0.962. Ah. Looks like my answer agrees with "nub data scientist". What is the probability that both he and I are wrong? :-) TLP and nub data scientists, Your answers include possibilities which are not feasible; we cannot have any combination of 2/3 and 1/3 together... what about (2/3)^3? I agree with TLP and nub scientist. For me, the question is really (1 - the odds that all three of your friends are lying to you) Clearly 1 - 1/3 * 1/3 * 1/3. It's convenient that they all gave the same answer, otherwise it would be more difficult. Let Y denote rain, N denote no rain Actual Answer probability ------------------------------------------ Y=> 8/27 YYY, 1/27 NNN, 12/27 YYN, 6/27 YNN N=> 1/27 YYY, 8/27 NNN, 6/27 YYN, 12/27 YNN So, P(Y|YYY) = (8/8+1) = 8/9 The probability of raining is that they are all telling the truth, therefore, (2/3)^3. P(rain / yes yes yes) = (2/3)^3 / ((2/3)^3 + (1/3)^3) =(8/27) / ((8/27) + (1/27)) = 8 / (8 +1) = 8/9 There is an obvious conceptual reason as to why several answers here (ones that don't use Bayes' formula) are incorrect. The probability in question has to depend on the probability of rain in Seattle. If, for the sake of discussion, it ALWAYS rains in Seattle, i.e. P(rain)=1, then the required prob. is always 1 as well. Likewise if it's a place where it never rains, or if the question asks about the prob. of it raining elephants given the 3 friends said yes, it'd be still 0. I believe this is a std. textbook example of the Bayes' formula, anything short of that I don't think will work out. Show More Responses Please correct me if incorrect. But I would just prefer to condition. either they are all telling the truth and its it raining or they are all lying and it is not raining. P(rain)=P(rain|truth,truth,truth)*P(truth,truth, truth)+P(rain|lie,lie,lie)*P(lie,lie,lie) notice that truth does not mean yes it is raining, it simply corresponds to them telling the truth. Since they said yes, IF they were lying and we knew they were lying then the probability of rain would be zero, thus eliminating the second term. P(rain)=P(rain|3xtruth)*P(3xtruth) and the probability of the truth is (2/3)^3 and the probability of rain if they are telling the truth is 1. I did a little skipping of steps, since truth doesnt equal yes, but i just sort of meshed it toegher towards the end YES=yes,yes,yes T=truth, truth, truth L=lie,lie,lie P(Rain|YES)=P(Rain|YES,T)*P(T)+P(Rain|YES,L)*P(L) P(Rain|YES,L)=0==> whats the probability of rain given we know that they are lying and theyve told us it is raining. P(Rain|YES)=P(Rain|YES,T)*P(T) P(Rain|YES,T)=1==> whats the probability of it raining given that they are telling the truth and have told us its raining then P(T)=(2/3)^3 its obvious. why in the world would i do bayesian methods when its certain I think the first answer is incorrect. The basic flaw is that it is assumed that all three friends lie together or be honest together, so it does not take the cases of Yes.no.Yes or Yes.Yes.no ...etc For the correct answer we need to update posterior probability after each yes so Assuming P(raining) =0.75 prior probabilty P(raining | yes) = (2/3)*0.75 / ( (2/3)*0.75 + (1/3)*0.25 ) = 6/7 P(raining | yes,yes) = (6/7)*(2/3) / ( 6/7*2/3 + 1/7*1/3) = 12/13 P(raining | yes,yes,yes) = (12/13)*(2/3) / ( 12/13*2/3 + 1/13*1/3) = 24/25 I dont see the interview saying that all friends are sitting together so they are independent which means they can lie separately I agree with (2/3)^3. This problem requires the marginal probability of rain to solve, following Interview Candidate's answer. M.B. provides the rationale behind why the bayes approach is necessary: if the pr(rain) = 0, then the pr(rain|y, y, y) = 0. (maybe it is July in Seattle). A few conceptual problems in many answers that I want to point out: 1) There is lots of conflation between Pr(truth) and Pr(Y). Pr(truth) = Pr(Y|R) does not equal Pr(Y). 2) Consider there is only a single friend and they say yes, the logical conclusion from a lot of these answers is that Pr(Rain|Yes) = Pr(Yes|Rain) = 2/3, which is not correct. Bayes' rule is very clear in this simpler case. 3) The friends' answers are conditionally independent assuming no collusion. The combinations of their honesty/lying adds no additional information. The marginal probabilities are not independent, Pr(y,y,y) does not equal pr(y)^3, it equals pr(y,y,y,rain) + pr(y,y,y, no rain), the integration of the joint space over rain. Using conditional independence and bayes rule, this becomes: pr(y|rain)^3*pr(rain) + pr(y|no rain)^3(1-pr(rain)). A more general solution using Pr(rain) = r. Pr(rain|y,y,y) = Pr(y,y,y|rain)*pr(rain)/pr(y,y,y) #Bayes' formula pr(y,y,y|rain) = pr(y|rain)^3 = (2/3)^3 #conditional independence pr(y,y,y) = pr(y|rain)^3*pr(rain) + pr(y|no rain)^3*pr(no rain) #by definition, see point 3 the answer: r*(2/3)^3 / [r*(2/3)^3 + (1 - r)*(1/3)^3] It should be (2/3)^3, I think zen and todo is correct. It's really shocking to see how many people post incorrect answers here with such confidence. That said, Bayes' rule is somewhat counterintuitive if you're not familiar with probability theory. Let P(y|r) = prob of each yes given raining = 2/3, P(y|n) = prob yes given not raining = 1/3. Let P(r) = probability of rain = 1/4 given the prior knowledge. P(n) = probability of no rain = 3/4. P(r | y^3) = ( P(y^3 | r) P(r) ) / ( P(y^3 | r) P(r) + P(y^3 | n) P(n) ) = ( P(y | r)^3 P(r) ) / ( P(y | r)^3 P(r) + P(y | n)^3 P(n) ) = ( (2/3)^3 (1/4) / ( (2/3)^3 (1/4) + (1/3)^3 (3/4) ) = (2/27) / ( (2/27) + (.75/27) ) = 2/2.75 = 8/11 In the absence of further information, the only correct answer is the posterior probability of rain p is in the interval (0, 1). In the absence of further information any prior is as good as any other, so by implication the posterior can take any value as well. The interval for p can be restricted to [0, 1] on the assumption that the question to the friends would not be posed if the prior is absolute certainty whether it will rain or not. With the further assumption that the prior probability is measured with limited precision (e.g. rounded to a percentage point), the posterior would be in the interval (0,075, 1). If the alternative assumption is made that information from the friends will be requested only if it had any chance to move the posterior below or above 0.5, the posterior interval for the probability is (0.5, 1). any more precise answer than that requires further information about the prior which is not supplied in the original problem formulation. Also note that even a precise answer about the probability of rain is not sufficient to answer the question whether an umbrella should be brought or not. Assume probability of raining in Seattle P(R) = 1/4 Assume friend says Y 50% of the time (Theoretical probability) P(Y) = 1/2 Probability of friend saying yes given its raining P(Y/R) = 2/3 Probability of 3 friends saying yes given its raining = P(YYY/R) = 8/27 Probability of 3 friends saying yes = P(YYY) = 1/8 P(R/YYY) * P(YYY) = P(YYY/R)*P(R) P(R/YYY) = 8/27*1/4/(1/8) = 16/27 (About 59%) A posterior probability of 59% given 3 yes and a prior probability of 25% sounds reasonable to me The probability of each of the friend say "YES" is 2/3 * 2/3 * 2/3 = 8/27. Now the probability that it is actually raining in Seattle depends on that how do I select them to phone. There is only three way to select and phone them. So, the probability that it is actually raining in Seattle is 3 * (8/27) = 8/9. Show More Responses Rule of conditional probability states P(A|B) = P( A & B ) / P(B) Reformulating to this case, P(Rain | 3Y) = P(R & 3Y) / P(3Y) P(R & 3Y) = 2/3 ^3 (if it is raining, then they must all speak the truth) = 8/27 (one could multiply probability of rain here. I assumed as prior) P(3y) = all truth or all lie = 2/3 ^ 3 + 1/3 ^3 = 9/27 hence P(R | 3Y) = 8/9 Let X be the probability it's raining. Obviously we want P(X|all three say yes). Now let Y be the probability at least one of them is lying. If Y = 0 it's easy to solve, if not then not so easy. Now you keep going. Obvious, bayesian is a way to go... Probability that it is raining given that all 3 of them said "yes" = P(AT LEAST one of them is telling the truth) = P(exactly 1 of them telling the truth) + P(2 of them telling the truth) + P(all 3 of them telling the truth) P(exactly 1 of them telling the truth) = P(of first person telling truth) * P(of 2nd person telling lie) * P(of 3rd person telling a lie) = (2/3) * (1/3) * (1/3) = 2/27 + P(exactly 2 of them telling the truth) = P(of first person telling truth) * P(of 2nd person telling the truth) * P(of 3rd person telling a lie) = (2/3) * (2/3) * (1/3) = 4/27 + P(exactly 3 of them telling the truth) = P(of first person telling truth) * P(of 2nd person telling the truth) * P(of 3rd person telling the truth) = (2/3) * (2/3) * (2/3) = 8/27 ANSWER: Probability that it is raining given that all 3 of them said "yes" = P(AT LEAST one of them is telling the truth) = P(exactly 1 of them telling the truth) + P(2 of them telling the truth) + P(all 3 of them telling the truth) = (2/27) + (4/27) + (8/27) = 14/27 What if the answer is 50% since the chance of rain and not rain does not depend on what your friends tell you. 8/27 is not the answer. For the weather to be nice in this case, all 3 of your friend NEED to have lied to you. Therefor the odds are 1/27. 26/27 is incorrect. That is the number of times that at least one friend would tell you the truth (i.e., 1 - probability that would all lie: 1/27). What you have to figure out is the odds it raining | (i.e., given) all 3 friends told you the same thing. Because they all say the same thing, they must all either be lying or they must all be telling the truth. What are the odds that would all lie and all tell the truth? In 1/27 times, they would the all lie and and in 8/27 times they would all tell the truth. So there are 9 ways in which all your friends would tell you the same thing. And in 8 of them (8 out of 9) they would be telling you the truth. Interview Candidate solves this problem using Bayesian stats despite the fact that no enough information is given to do Bayesian probability analysis i.e. he had to pull the probability of it raining in Seattle out of thin air when it was not given in the interview question. With only the information from the interview question, we have to assume that friends are either all lying or all telling the truth. Let truth=T and lie=L P(TTT)=8/27, P(LLL)=1/27, P(TLL)=2/27,P(TTL)=4/27. But we know that they all had the same answer, so we must compare P(TTT) to P(LLL). P(TTT) is 8 times more likely than P(LLL), so we have P(All same answers|TTT)=8/9, P(All same answers|LLL)=1/9. Therefore the solution given ONLY THE INFORMATION GIVEN is P(Rain)=8/9, P(Dry)=1/9. Most of the answers/comments made all unconditional assumptions except a few reasonings that lead to the 8/9 probability. Note that the question states that "Each of your friends has a 2/3 chance of telling you the truth". This essentially means P(raining, yes) + P (non-raining, no) = 2/3. Any attempts to interpret this as conditional probability P(raining | yes) = 2/3 or P(yes | raining) = 2/3 are making other assumptions. As a big dumb animal, I have to write out a probability tree and thing about this simply. You only have 2 scenarios where all three say it is raining (all three are telling the truth-raining OR all three are lying - not raining). Assume the probability of rain is 0.5 for simplicity. P(Rain and YYY) = 1/2 * 2/3 * 2/3 * 2/3 = 8/54 P(Not Rain and YYY) = 1/2 * 1/3 * 1/3 * 1/3 = 1/54 Thus P(Rain | YYY) = P(Rain and YYY) / [P(Rain and YYY) + P(Not Rain and YYY)] = 8 / (8+1) = 8/9 I know it isn't the most mathematically rigorous or syntactically correct solution, but I'd bet a pretty penny that the answer is 8/9 with the following assumptions (P(rain) = 0.5 and naive bayes - friends didn't collaborate). |

You have a birthday cake and have exactly 3 slices to cut it into 8 equal pieces. How do you do it? 39 AnswersCut in half, stack, cut in half, stack, cut in half. All you have to worry about is the 45 degree rotation of one of the 4 pieces after the second cut. Blade can be kept in place, like a paper cutter, as to minimize the margin for error. Slice it horizontally across the middle creating two equal halves top and bottom. Then simple two slice cross from above like normal. Cut each slice into 3 slices. Then eat one of them. Show More Responses This is really an easy one. First cut into half across the top, then cut the halves in half also across the top (you now have 4 equal pieces) then cut across the middle = 8. No, Jason and Sharon, you will only wind up with 6 slices. z, too many stacks. You need to cut in half, then make another cut - to get four pieces. NOW you stack these four pieces and make the last third cut - and you get 8 pieces. A rather easy lateral thinking question. Alina's got it. The stacking seems to be the "right" answer. But this is a stupid question. Who stacks cake? The frosting from the bottom slice would meld with the stacked slice, thus making the cake inseparable. I wouldn't get the job because I would swear at the interviewer for asking a dumb question. What good is an answer to this question if it wrecks the cake? Assuming the cake is square: slice 1: cut horizontally to create 2 equal pieces slice 2: cut vertically to create 4 equal pieces slice 3: line up all 4 pieces of cake side by side and cut horizontally to create 8 equal pieces. don't stack, it will ruin the frosting. With a knife Alina would be penalized for not being able to count past 6. But then, she could get a job at another company where they appreciate people who say someone's idea is wrong, then put forth the same idea and take credit for it. A new solution for you: who says slices have to be a straight line and not circular? I would cut a concentric circle in the middle (would have to calculate the radius compared to the whole), and then slice an X with the remaining 2 cuts. It will look like a target. If done correctly the sizes will be the same, it says nothing about having the same shape! I guess it's much easier if you think of two planes: first cut in half, then to quarters. That's the easy part. Now look at the cake from the side, and cut it across... Each quarter is cut into two and all pieces are equal. I would consider the interviewer's emphasis on "equal pieces." While my first thought was to bisect across each of the three dimensions, half of the pieces would end up with less frosting than the other half. Stacking the pieces would result in frosting transfer, which would also screw up some of the pieces. Therefore, I'd go with lining the pieces up and have a large knife on hand for each bisection. Hey, people get crazy about their cake slices. Show More Responses I would take a different approach to this. First of all the question asks for the cake to be cut into 8 equal pieces, not 8 identical or 8 of the exact same size. Equal doesn't always have to mean the same, just equivalent to. First I would find out who I am cutting the cake for, if its 4 old ladies and 4 young guys, equal pieces would not mean that they all needed to be the same. If everybody wanted the exact same amount of cake I would figure out a way to give everybody 12.5% of the entire cake volume, but if some wanted larger or smaller pieces I would come up with a way to satisfy each individuals desire. If you know how to cut an arbitrary shape in half, you have the solution. After every round, plan the cuts for each individual piece. Then align them so the proposed cuts are in one straight line. Make a cut. This way you can cut any cake into 2^n equal size pieces with n cuts. An interesting question is, if you start with one connected piece, will you always be able to end up with connected pieces. Think of cutting letter S in the middle, like this: $. You end up with two equal figures that are not connected (or, in other words, with 4 pieces). It's also easy to design a cake that can be split into 8 pieces with one straight cut. I LOVE Andrew's answer! Eat one of the freakin' pieces. That's the corporate way in America anyway. Mike is either a socialist, or works in non-profit, or government. I thought "slice them long ways" but then someone misses out on the freaking frosting, which is the best part. UNLESS, it's a layer cake. Cut 'em all in thirds and give the extra to the birthday boy/girl to take home. First I'd yell at whoever cut the cake incorrectly to start with. He's ruining the party. Then I'd squish the 3 pieces of cake together and re-cut the cake into the required 8 pieces. Boom. This is as easy as pie. Viewing the cake from the top, make 1 cut vertically down the middle of the cake and another horizontally. Viewing the cake from the side, make your third cut horizontally through the middle; QED three slices and 8 pieces of cake with a beamsplitter and prisms it could be done in 1 (with a laser) That's an oddly presented question that is understood 2 ways: - 3 cuts allowed to cut one cake in 8 pieces. Which yields cut in 4 parts, then split those in 1/2 again with the last cut, either by stacking, realigning the slices or making a round cut. - 3 pieces of cake must be re-cut to make 8 equal parts. Which is an impossibility unless one piece is 2/3 smaller than the other 2. That yields different answers like cutting in 3, and eat one to leave 8 pieces. They key to answering any of the brain teaser questions is to ask a few critical questions before even attempting to answer. I would start with: Is the original cake round or square? If square, line up all three pieces and recut to be 4 equal widths of cake. If round, was the original cake cut in 6 or 8 pieces? If 6 pieces you have 1/4 of a cake = easy to redivide into 8 equal slices. If 8 pieces, you have 1/3 of a cake and a little math needs to be applied to create 8 equal slices. First slice a strip off each of the 3 slices to create a fourth slice. then divide each in 1/2 to make 8 equal slices. Cut each slice into 8 small slices. Then give each person 3 small slices. Show More Responses There are some posting above who seem to not have a good grasp of numeric's. The answer is not that difficult. First, presume the pieces are not equal size (nothing states they are). Second, presume two pieces are of equal size and the third piece is twice that size. Third, cut vertically (the most usual manner in which to cut cake) the 2 equal pieces (we now have 5 pieces -4 the same size and one larger piece). Fourth, cut the large piece in half, then those two pieces in half again. Fifth, voila, one now has eight equal pieces of cake. Hmmm, I always assumed they meant three knife cuts by the word "slice" Kind of interesting to me that others assumed the cake was given to you in 3 parts as defined by the word "slice" I'd say that you should cut the cake horizontally using the knife as a measuring device to find the exact center of the circle, then cut vertically using the same method, then take each quarter , using the knife as a straight edge, build an alignment diagram that places each set of two quarter pieces point to point along an axis that defines their center lines, and cut all 4 quarter slices with a single cut of the knife ( defined by the word slice ). Put it all in a blender. Pour each of the resultant mixture onto a plate or into a bowl. 1. assemble 3 sliced cakes into a big cake (original shape) 2. cut it half (don't care about the indentation) , you would get 2 piece of cake 3. cut it half again, you would get 4 pieces of cake 4. cut all of them half again, that's finish. To those who think it means you start with 3 pieces ("slices") of cake, READ IT AGAIN. It says (emphasis added): “You have a birthday cake and have exactly 3 slices to cut IT into 8 equal pieces." Get it? "... to cut IT [the cake] into 8 equal pieces."... There is NO WAY it means to cut 3 slices of cake, otherwise it would say "...exactly 3 slices to cut into...". And Mike: "equal doesn't mean same, just equivalent". That's the funniest (and stupidest) thing I've heard all day. Anyway, since 2^3 = 8, you have to stack. Assuming a round cake: Cut (or "slice") 1 creates 2 semi-circles. Stack them. Cut 2 creates 4 quarter-circles. Stack then Cut 3 creates 8 1/8th circles. is the 3 slices equal in size? Great answer and explanation here: http://www.programmerinterview.com/index.php/puzzles/birthday-cake-8-pieces/ Make sure the guest of honor has Blown out candles 1st! (was not specified but hey so were many other things) If the birthday boy/girl is under the age of 10, I am not too sure you want to be messing with their cake!! Cakes come in many different sizes and shapes...ESPECIALLY Birthday Cakes!!! ACK They even come in characters and shapes you can NEVER get into equal pieces but, back to the solution! Will use 2 shapes: Round and Square! Cut 1: Parallel to cutting board and horizontal to create 2 layers of equal depth; Cuts 2 and 3: Perpendicular to cutting board once then rotate 90 degrees and repeat! Now give it to the Kid in the high chair to for quality control/assurance! Like Andrew, I would eat one piece and then cut the 2 in four equal pieces. Remember 1 whole cake, 3 slices with a knife = 8 equal pieces Place cake flat on table. Grab a knife big enough to cut the cake horizontally. 1st cut - Cut the cake horizontally leaving the cake flat on table as if the cake still in one single piece. Now you have 2 cakes instead of one. 2nd and 3rd cut - cut through the cake vertically in the form of a cross. Now you have 8 equal pieces of cake. As if you had cut 2 cakes in 4 pieces each. Show More Responses I would state that I only eat cakes in the shape of circle. then 3 equal cuts across the middle. think of it like a pizza... or a pie.... or a pizza pie. Remember these questions are made to have you think outside the box. Not all cakes are square. cut the diagonal portion then centre line of cake Cut each of the 3 slices into 8 equal parts which makes the slice count 3*8 = 24, Divide the 24 between 8 people 3 each. Cut 2 slices into 4 pieces each, cut the third one into 8 pieces. Separate 2 of the 3 slices, dividing 2 slices for 8 people is easy (each slice in 4) Then with the left piece I divide it in 8 and offer one to each person. One more: I could put all the 3 pieces together and re slice into 8 equal pieces. |

Suppose you had eight identical balls. One of them is slightly heavier and you are given a balance scale . What's the fewest number of times you have to use the scale to find the heavier ball? 48 Answers3 times. (2^3 = 8) Two. Split into three groups of three, three, and two. weigh the two groups of three against each other. If equal, weigh the group of two to find the heavier. If one group of three is heavier pick two of the three and compare them to find the heaviest. Brian - this would be correct if you in fact were using a weighing scale, and not a balance scale. The ability to weigh one group against another with a balance scale allows Marty's answer to be a correct answer. Although - the question as worded provides a loophole. If it had been worded as "What's the fewest number of times you have to use the scale to CONSISTENTLY find the heavier ball", then Marty's answer would be the only correct answer. However, it is possible that you could get lucky and find the heavier ball in the first comparison. Therefore, the answer to the question as stated, is ONE. Show More Responses This question is from the book "How to move Mt Fuji".... Marty has already got the right answer. Actually Bill, by your interpretation of the question the answer is zero, because you could just pick a ball at random. If you get lucky, then you've found the heaviest ball without using the scale at all, thus the least possible amount of times using the scale would be zero. The answer is 2, as @Marty mentioned. cuz its the worst case scenario which u have to consider, otherwise as @woctaog mentioned it can be zero, u just got lucky picking the first ball.... None- weigh them in your hands. Assuming that the balls cannot be discerned by physical touch, the answer is 3. You first divide the balls in two groups of 4, weigh, and discard the lighter pile. You do the same with the 4 remaining, dividing into two groups of 2, weighing, and discarding the lighter pile. Then you weigh the two remaining balls, and the heavier one is evident. 2 3a+3b+2 = 8 if wt(3a)==wt(3b) then compare the remaining 2 to find the heaviest if wt(3a) !== wt(3b) then ignore group of 2 discard lighter group of 3 divide the remaining group of 3 into 2+1 weigh those 2 If == the remaing 1 is the heaviest if !== the heaviest will be on the scale i think its 3. i would take it like this OOOO OOOO then OO OO then OO problem solved. i do this everyday. bye. praise be to allah. thats it. It's 2. Period. If you can't figure it out look it up online or in "How Would You Move Mount Fuji" (like somebody else said). This is one of the most basic brainteasers you could be asked in an interview. The answer is 2. 1) Divide the balls into 3 groups. 2 piles with 3 balls each, 1 pile with 2 balls. 2) Weigh the 2 piles of 3 balls. If both piles are the same weight, discard all 6 and weigh the last 2 to find the heavier one. 3) If 1 pile of 3 is heavier than the other, discard the lighter pile and the pile of 2 balls. Weigh 2 of the remaining 3 balls from the heavier pile. If both of the weighed balls are equal, the last ball is the heavier one. Amy is 100% correct for the following reason: everyone (except Amy) is solving the theoretical problem. The practical side of the problem - notwithstanding jimwilliams57's brilliant observation that if one weighs more than the others IT IS NOT IDENTICAL (would have loved to see the interviewer's face on that one) - in order to 'weigh' them on a scale, one has to pick them up, therefore, you will immediately detect the heavier one without weighing: pick-up three and three ... no difference, no need to weight. Pick-up the remaining two to determine the heavier one. Steve Show More Responses 3 times. Not having looked at the other comments, hopefully, I am the 26th to get this right. Put the balls 4 and 4 on the scale, Take the heavier side and place those balls 2 and 2 on the scale. Take the heavier side and place them 1 and 1 giving the heaviest ball. OK, now I read the comments and see that the people, like the question are divided into to groups, systematic approach people that say 3 (like I did) and analytic people that say 2. It takes a systematic person (me) a minute to get the answer. I'm guessing it took the analytic 5 minutes just to interpret all the ramifications of the question, i.e. they aren't idenitical if..., do it by hand..., get lucky. minimum is 1 (if lucky - 25% chance by picking 2 balls at random) & max is 2 (using most efficientl process to absolutely determine without luck - 3/3/2 scenario) While Symantec was busy weighing my balls I took a job with NetApp.... They need to focus on hiring good, capable security engineers, not weighing their balls. You have 12 balls, equally big, equally heavy - except for one, which is a little heavier. How would you identify the heavier ball if you could use a pair of balance scales only twice? The problem is based on Binary Search. Split the balls into groups of 4 each. Choose the heavier group. Continue till you get the heavier ball. This can be done in log(8) (base 2) operations, that is, 3. Since there is only one scale available to weigh. You first divide the balls in half. Weigh each group, take the heaviest group. This is using the scale twice so far. Now, divide the previous heaviest group into half, weigh both groups. Take the heaviest. Divide this last group and take the heaviest. This is the heaviest ball. We have used the scale 5 times. 3. 2 times. 8 balls. 1st step: [3] [3] [2] 2nd step: [[1] [1] [1]] [[1] [1] [1]] [[1] [1]] The fewest number of times to use the scale to find the heavier would be Eight to One times ? Show More Responses It will actually be 1 because the question asks what's the fewest amount of times which is one because you could just get lucky you can use any method you want it would still be one because that is the fewest amount of turns you can have 3 2 as many have indicated above. The 3 is the kneejerk reaction but 2 is the correct answer. Marty's answer is correct, but he does not explain why. The logic of the balance scale is three-valued: . Its most efficient use is the recursive application of the three-valued logic until there is only one item left. The integral ceiling of ln(x)/ln(3) thus gives the fewest number of times you have to use the balance scale to find the uniquely heaviest ball of x balls. Ceiling(ln(8)/ln(3)) = 2. Correct answer has already been posted. I just want to contribute some theoretical analysis. Given N balls, one of them is heavier. Finding out the ball requires log3(N) trit of information. (trit is the 3-base version of bit). Each weighing may give you one of the three outcomes: equal, left-heavier, right-heavier. So the amount of information given by each weighing is upper-bounded at 1 trit. Therefore, theoretical lower-bound for number of weighings in the worst case is log3(N), which is actually attainable. So 27 such balls need only 3 weighings and 243 balls need only 5 weighings, etc. You would not be able to find a ball heavier than the others. All eight balls are identical; therefore, they must all be the same weight. test answer 2016-01-12 00:34:07 +0000 Use an equilateral triangular lamina which is of uniform mass throughout. It is balanced on a pole or a similar structure. Steps: Place 2 balls at each corner (total 6 balls) i. if the odd ball is one of those, one side will either go up or go down. Now repeat the process with one ball at each corner including the 2 unbalanced ones. ii. if balance is perfect, repeat the process with the remaining two balls and one of the already weighed balls. It's one. The fewest number of tries on using a balance scale would be one. If you put one ball on each side and one is heavier, you have the found the heavier ball. No idea Show More Responses I stumbled across this while looking for something else on Google but I had to answer. It is 2, split balls into 2,3 and 3. weigh the 2 groups of 3 against each other. If equal weigh the group of 2 and the heaviest is obvious. If they are not equal keep heavy group of 3 and weigh 2 of the balls. if equal heaviest ball is one you didn't weigh. If not equal the heavy ball is obvious. Would it be wrong to say for a sample size as small as 8, we might as well not waste time thinking about an optimal solution and just use the scale 7 times, as this will be more efficient than coming up with an ideal solution prior to using the scale? The point of these interview questions is to both check your logical brain function and to hear how you think. Most of you are just posting jerk off answers trying to be funny, or you are really dumb. These answer get you nowhere with me in an interview. Think out loud, go down the wrong path back track try another logic path, find the answer. None of this "0 if you use your hands". That is fine if you are interviewing for a job in advertising where creativity is desired, nobody wants you writing code like an 8 year old. English isn't my mother tongue... What is a balance scale? If looking up on Google, I find some devices with two bowls on a bar bearing in the center. Hence, the answer is once (if I'm luck enough to select the heavier ball in teh first measurement) If a balance scale allows to measure only one ball at a time, then it would take two measurements, unless you'd have more information on the weight, which is not listed here, hence doesn't exist in the context of the question^. Respectfully, the folks who are answering "3" are mathematically modeling the nature of the balance incorrectly. Performing a measurement on a balance scale is not binary. It is trinary. Each measurement gives you one of three responses: The left is heavier, the right is heavier, or they are equal. So while you do need three binary bits to specify a number from one to eight, you need only two TRINARY-DIGITS Formally, you want the smallest value of n such that 3^n >= 8. The answer is 2. Note that you could add a ninth ball, and still, you'd only need to make two measurements. Of course, the smarty pants answer would be one. Just pick two balls at random and be lucky to have chosen the heavy one. But you're not guaranteed to be able to do it in just one measurement. First off, take yourself through the process visually and forget square roots, that doesnt apply here and here is why: The question is the Minimum, not the MAXIMUM. BTW, the max would be 7 ( 8-1); you are comparing 2 objects, so 1 ball is eliminated automatically in the first step. Anyway, you have a fulcrom of which you are placing 2 of 8 objects on each end. If by chance you pick the slightly heavier object as one of the two balls, you have in fact, found the slightly heavier one in the first round... btw dont be a smartass with your interviewer, he is looking for smarts not smarmy;) 1=if all the balls are identical and you pick up the first...balance it and the second one is lighter or heavier then you've found the heavier ball in the least amount of attempts. 2=if all the balls are identical and you pick up the first...weigh it and the second one is lighter or heavier then you've found the heavier ball in the least amount of attempts. Fewest - get lucky and pick the heaviest one. But wait! How would you know it is the heaviest one by just weighing one ball? Your logic is flawed. Two groups of four. Split heavier one, weigh. Split heavier one, weigh. 3 times. 2 weighings to find the slightly heavier ball. Step 1. compare 2 groups of three balls. Case 1. if they are both equal in weight, compare the last 2 balls - one will be heavier. case 2. If either group of 3 balls is heavier, take 2 balls from the heavier side. compare 1 ball against the 2nd from the heavy group result 1. if one ball is heavier than the other, you have found the slightly heavier ball. result 2. if both balls are equal weight, the 3rd ball is the slightly heavier ball. Easy Shmeezi Show More Responses None. They are identical. None is heavier. Without judging by hand: Put 4 balls on one side, and 4 on the other. Take the heavier group and divide again, put 2 balls on one side, and 2 on the other. Take the 2 that were heavier, and put one on each side. You've now found the heaviest ball. This is using the scale 3 times, and will always find the right ball. so once, or the creative answer zero if you allow for weighing by hand just once. Say you are lucky and pick the heavy ball. One use of the scale will reveal your lucky choice With the systematic approach, the answer is 3. But, if you randomly choose 2 balls and weigh them, and by coincidence one of these two is the heavier ball, then the fewest number of times you'd have to use the scale is 1. Although the real question is: are the balls truly identical if one is heavier than the rest? |

### Trader at Morgan Stanley was asked...

If two cars are traveling in a two lap race on a track of any length, one going 60 mph and the other going 30mph, how fast will the slower car have to go to finish at the same car to finish at the same time? 30 AnswersIt's impossible, the faster car will be done the race by the time the slower car finishes the first lap. the answer to this question lies on how long the race track, we can solve its mph if we know how long the track we be. Well, this is interesting because there are no track details and makes for multiple answers through ambiguity and assumptions. i.e. One could assume that it is a circular track and that the two lanes are very wide and that one car is on the outermost furthest from the centre and the other is on the track very near the centre. The circumference of each track therefore could be such that the faster car would have to travel twice the distance that the slower car has to and therefore the two cars would arrive at exactly the same time. The is why cares on a racetrack must start at offsets to each other or have their times corrected in some other way! In real-life, this is highly unlikely however it does demonstrate my point. Show More Responses I agree with the first answer (by the Interview Candidate). When the slow car completes the first lap, the fast will complete the second lap. It does not matter how fast the slow car goes on the second lap; it cannot win... 90 mph Wouldn't the slow car just need to go 60mph? It doesn't say that the fast car is going double the slow cars speed only that the slow car is going 30 mph and the fast is going 60mph. The question is a trick. It says how fast will the slower car have to go to finish "AT THE SAME CAR" to finish at the same time? It can go any speed!! It will always finish at the same car (2nd) at the same time. The car isn't changing!!! I'm assuming that the question, as typed, was entered incorrectly and that it should be worded, "How fast will the slower car have to go to finish at the same time as the faster car?" The answer is 30mph. Because that's how fast the slower car is going. Nowhere in the question does it state that the cars are at the same point on the track. The slower car is currently halfway between the faster car and the end of the race. The two pieces of missing info are: 1. How long is the distance of the track and 2. The distance that each of the cars has already traveled on the track. If you have that info then you can figure it out. The two pieces of missing info are: 1. How long is the distance of the track and 2. The distance that each of the cars has already traveled on the track. If you have that info then you can figure it out. I totally agree with wildfire. Did you just say, "If two cars are traveling in a two lap race on a track of any length, one going 60 mph and the other going 30mph, how fast will the slower car have to go to finish at the same car to finish at the same time?" WTF? Are you having a stroke? Try to raise both hands above your head. OK, now smile for me. And would you please try to say a complete sentence? The way the question is currently worded, it does not indicate any of the following: 1. Whether the two cars started at the same place, at the same time (we can infer "same place, same time" because it is a race), 2. Whether either car has traveled any distance at all (if yes, then how far; if the slower car has traveled one lap, then the faster car has finished, and if no, then the answer is 60 mph), 3. What is the shape of the track (to Alanjai's point, a regular track requires offset starting positions, whereas a figure-8 track with fixed lanes would not), and finally 4. Why the question is worded so poorly ("to finish at the same car to finish at the same time" ... I mean, come on, that's practically not even literate). Show More Responses Speed a = Car A speed = 60 mph b = Car B speed = 30 mph t = Time Elapsed (in hours) d = Race Distance (in miles) ((t * a) = distance traveled by Car A) - d = Distance Remaining Car A = dra ((t * b) = distance traveled by Car B) - d = Distance Remaining Car B = drb x= mph that Car B has to drive for the remainder of the race (drb/dra)= y y * a = x or ((t*b)-d))/((t*a)-d)) = y y * a = x Example: t = 1 hour d = 240 miles ((1 * 60) - 240 = 180 [distance remaining Car A] ((1 * 30) - 240 = 210 [distance remaining Car B] 210/180 = 1.666666667 1.666666667 * 60mph = 70 mph, the speed that Car B has to drive for the remainder of the race. oh, yeah... in case you couldn't guess, I'm a Digg user. oh, yeah... in case you couldn't guess, I'm a Digg user. I agree with wildfire. This question is not grammatical and is unsolvable as written. The point seems to be that you should read the entire question (review the entire problem) before jumping in to solve the question that is immediately apparent. So, attention to detail is important at this company. Assuming the question was mistyped into this discussion, and they want to know how fast the second car would have to go to finish at the same time as the first car, then the answer is: infinitely fast. The question is better expressed as: A car is driving a sixty-mile path at thirty miles per hour. At the half-way point, the driver wants to speed up so his average speed at the end of the path is sixty miles an hour. How fast does he have to go? At the half-way point (30 miles) he has taken one hour for his drive. To average 60 MPH, he would have had one hour for the entire road. Therefore he has no time left, and must travel infinitely fast (for zero time) to average 60 MPH. It doesn't matter what answer you give, it is how you come to your conclusion that counts here. There is missing information on purpose because they want to see how you solve problems, not if you can solve problems quickly. The cars, the track the speed doesn't matter, it is the questions you ask and the information gathering that counts. Since there are only 2 cars in the race, the race is over and the instant one of the cars passes the finish line. One car finishes first, the other finishes second by default. The answer is that it doesn't matter how fast either of them are going, or how long the track is. They will always finish at the same time (not to be confused with "finishing with the same lap time"). I agree with SteveC. Once the either car finishes, the race is over. The question was clearly misworded. If not, most of you would have failed. The best answers here are from toolbelt_1 and dadag. Morgan Stanley needs people with exceptionally strong quantitative abilities and communication skills. The interviewer gives you a vaguely worded question to see (1) how you would gather the rest of the information and (2) how you would use it. In the course of a real workday your manager, client or other stakeholder will rarely provide a perfectly well-defined request for information. In the heat of the moment, important questions are worded quickly and vaguely, yet your performance will be judged based on how well you respond. One of your most crucial job skills is determining true requirements through timely and effective follow-up communication, intuition and experience. Show More Responses Both cars will finish at the same time if the track length was 0. This is typical of Morgan Stanley. Search a bit more and read about the lack of communication and clarity within this company--and when the result is as it should be (wasted time and effort) they blame the lower level worker as Al did above. If you ask for more information, you get more of the same -- confusion. Al might ALSO work for Morgan Stanley and makes a flimsy excuse for wasted time in having to track down pertinent information for the task. He makes no mention of the increasing frustration, lost productivity and the poor underlings that take the blame for poor managers. There are a few upper level managers who communicate and instruct their reports very well. It is a breathe of fresh air. They will tell the report the objective, quick background and the task and then you go do it. That simple. Others have more time for backstabbing, gossip and slimy character demonstrations than instructing their reports. No wonder they will never catch up to Goldman Sachs. They just don't get it. it's quite easy guys, just think: 30 mph is the current speed x is the race lenght 60 mph is the target average speed so theanswer is 30*(miles raced/ total race) + speed to achieve*(iles missing/tot. race) = 60 speed = i know that yu can dothis.....;) I'm pretty sure this is how the question is supposed to be worded which makes Mike's response correct. If two cars are traveling in a two lap race on any length track, one going 60mph for the entire race and one going 30mph to begin the race, how fast must the slower car travel for the rest of the race once the faster car finishes its first lap to finish at the same time as the faster car? If this is the case then we can do the following. distance = rate X time let d = the length of the track. After the fast car completes one lap the slow car will have completed one half lap, or .5d So the fast car has d left to go and the slow car has 1.5d left to go. since distance = rate x time, and the fast car is going at 60mph, we have d = 60t where t is time. For the slow car, if we let x be the rate it will go (so what we're ultimately trying to solve for, we have 1.5d = xt. now substituting d = 60t in we have 1.5 x (60t) = xt Since the track has some distance, t cannot be zero so we can divide t out leaving 1.5 x 60 = x = 90mph. Hence the slow car would have to travel 90mph the second lap to finish at the same time as the fast car. Make it simple, it depend on the fast car, if fast car got no problem( like break down , flat tires...), it hard to pass. The slow car just got to wait, time and opportunity is the key. Car A - 30mph Car B - 60mph One Lap - X miles Car A will have to decide whether it wants to catch up before completing the first lap. Otherwise it's over. We have two missing variables. We can't solve it. The speed will be calculated based on car's A location. Car A has to accelerate at any point prior reaching X. For instance, at 1/2X miles Car A will have to travel 90mph to finish at the same as time as Car B. But at 3/4X it will have to go faster. So the closer it gets to reaching X, the faster it will have to drive. Let's say the track is 60 miles long. Car 1 has completed a lap of 60 miles after one hour, and car 2 has traveled 30 miles. For the second lap (which is one hour for Car 1 to finish), car 2 must travel 90 mph. This works with any distance; this one is the easiest to visualize. |

### Explore Microsoft at Microsoft was asked...

Devise a way to make sure there is always mlik in my fridge. 31 AnswersSuper vague question. Looking back, I realized that they were looking for me to ask a LOT of questions to make the question clearer and to see my thinking process. put a female mammal in there spill some and it was always be there Show More Responses Depends on the position one is applying for - who do you want to be directly responsible for it and who will have oversight and authority to implement the plan? the owner of the fridge? Then establish a system to prompt the owner to check milk level and process for him/her to obtain the milk. the interviewee? Take direct responsibility to check and obtain or delegate the responsibility to an appropriate person, e.g. set up automatic delivery schedules.... Administer a drug to the interviewer that makes him mortally dependent on milk that is six days old. If he/she is going to ask ridiculous questions, ones answers should be equally outlandish. Just start vomiting.... Put in a container of milk and never drink any. Have a slot for a gallon or half gallon of milk that measures the weight of the container. One the milk runs low the refridgerator could light up a light, order milk online, text the owner, etc. The control scheme would have to take into account the possibility that the milk was removed for use or discard. An adjustable time delay with a default of 2 hours would work. Greater than 2 hours and the indicator/message is tripped/sent. the one about putting a female mammal in the fridge is delightful and completely out of the box (pun intended)...but end result is that thats ensuring a (live) animal is in the fridge and not neccessarily milk :-) how bout directly piping in milk from a dairy once a day / periodically based on expected consumption (the functional nature of the fridge is then changing, of course...) Get a bunch of UHT long-life milk. Can easily be stored outside the fridge without spoiling Get a bunch of UHT long-life milk. Can easily be stored outside the fridge without spoiling Er, go to the store before you run out? Live in the supermarket. Show More Responses Going back to the initial comment made by "Interview Candidate", solving this type of problem, where there are varying level of solutions, it comes down to the requirements for the solution. You could get fairly outlandish, as many of the responses show. How strict is the requirement for "always", for example. A solution that is 90% effective is VERY different in scope and cost to a solution that needs to be 99.999% effective. The solution can vary from a post-it reminder to get milk to an application that automatically places an order for milk to a grocery deliverer (as mentioned by "Former Msoft Candidate"). There's the marketing aspect of it as well. Who's the solution targeted to? For Bill Gate's personal use? Or for mass marketing (if so, what's the target market segment)? Even though the interview was for Microsoft, with past history for enigmatic interview questions, my first response would be to try to determine the intent of the question. Does the interviewer want outlandish responses to show that you are a creative thinker? Or do they want to figure out the steps that you would follow to solve a problem? Going back to the initial comment made by "Interview Candidate", solving this type of problem, where there are varying level of solutions, it comes down to the requirements for the solution. You could get fairly outlandish, as many of the responses show. How strict is the requirement for "always", for example. A solution that is 90% effective is VERY different in scope and cost to a solution that needs to be 99.999% effective. The solution can vary from a post-it reminder to get milk to an application that automatically places an order for milk to a grocery deliverer (as mentioned by "Former Msoft Candidate"). There's the marketing aspect of it as well. Who's the solution targeted to? For Bill Gate's personal use? Or for mass marketing (if so, what's the target market segment)? Even though the interview was for Microsoft, with past history for enigmatic interview questions, my first response would be to try to determine the intent of the question. Does the interviewer want outlandish responses to show that you are a creative thinker? Or do they want to figure out the steps that you would follow to solve a problem? As Interview Candidate said, this is clearly a question designed to explore your problem solving skills rather than to elicit a specific unitary answer. The "left field" nature of this sort of question can really throw those unfamiliar with the technique - I am reminded of the "good cop / bad cop" routine that I endured once in ignorance that it was a recognized interview technique (ironically, they offered me the job, but I declined because I didn't want to work with jerks like that). As for the milk question, I agree that the "correct" response is to explore the requirements in more detail. Make the refrigerator "Moo" when the milk slot is empty. It would get on your nerves so badly that you would run out and buy more. As Interview Candidate said, this is clearly a question designed to explore your problem solving skills rather than to elicit a specific unitary answer. The "left field" nature of this sort of question can really throw those unfamiliar with the technique - I am reminded of the "good cop / bad cop" routine that I endured once in ignorance that it was a recognized interview technique (ironically, they offered me the job, but I declined because I didn't want to work with jerks like that). As for the milk question, I agree that the "correct" response is to explore the requirements in more detail. Put powdered milk in the fridge By all means I will find out the extent and expense perimeters allowable for my solution, but I will have to assume that the question is open to my own interpretation and not bound by creative limits. Thus, a generic technocratic solution (considering that I am applying for a job with a technology company) to cater to all parameters is sought here. My proposed answer would go along the lines of: Build or customise a modern refrigerator that can be connected to the internet (deluxe fridges with internet connectivity are already available), is chock full of sensors and nanosensors, and can be programmed (via the Windows Mobile operating system of course!) to issue reminders to the household members via SMS, email, onscreen display at the fridge door, and text--to-speech verbal reminders, all issued before milk runs out. Presumably, to ensure higher accuracy, reliability and user flexibility in ensuring milk supply, this fridge provides a special container for milk to be poured into it for dispensing. The front of the fridge contains a standard dispenser mechanism for the milk. The milk container is antibacterial and nanoparticles on the plastic ensure minimal bacterial proliferation of the milk over time. Sensors detect the level of milk protein in the container, as well as the level of lactic acid buildup. This ensures that only milk is poured and kept in the container. Milk that is starting to go bad is detected, and warning messages are issued ahead of time to remind household members to clear and clean the container (as well as the antibacterial tubing and liquid flow path of the milk leading to the dispenser unit) and refill it with a fresh supply of milk. To provide flexibility and automation, the system allows the user to program the Windows Mobile interface to automatically place an order for milk delivery with a local internet-savvy supermarket or grocer. Other programming options include giving household members a choice of flavours when ordering from the e-grocer the next time around (to have a change of flavour or to cater to different domestic uses) or for the household members to send a specific message to the e-grocer concerning milk or any other food item that is monitored by the fridge. This is the basic schema for a typical household for one standard type of milk to be stored in the fridge. If household members desire more than one kind of milk to be kept in the fridge at any one time -- for example, milk of different flavours or animal origin -- the fridge can be customised with two sets of milk container/dispenser mechanisms. put milk in and weld it shut Get a job so you can buy fresh milk regularly. Put it in the fridge before the previous container is empty. Alternatively, get a VERY large fridge and install a cow, a warming-blanket for the cow, fresh air supply, feeding and waste disposal, and a milking machine. Get a job so you can ensure a supply of bull semen to impregnate the cow and replace the cow as needed. My experience tells me that this question is not about the question at all. Therefore,I would ask enough questions to determine the point of the question. As others have said and I concur, I'm pretty sure that problem solving skills are at least part of the point. Another aspect to this line of questioning might be that the interviewer/interviewing team may just want to see how I think, how fast I think, how creative I am, and how far do I delve into answering the question. Are they looking for complex abstract inventions or is a post it note on the fridge enough to cover the problem. If I'm talking to techno wizards or technical experts, they may want to hear a very intellectually abstract answer. If I'm sensing that the person/team just wants to get to the bottom line of keeping milk in the fridge, then I would keep it short and sweet. Bottom line for me would be to probe enough to get some kind of feel for or sense of what they are looking for and then give it my best shot. Show More Responses The heck with the milk. If someone can devise a way so my refrigerator is always full of beer, please post back! This is similar to the problem of always making sure that we get water in out bathrooms. For this we need to make sure that there is always some water in the tank on the roof top. We have an automated motor which pulls up water from ground in to the tank if the level of water in the tank drops below a threshold value. The motor gets turned off automatically when the water level reaches its max in the tank. Matter of redundancy. Measure variability of milk consummation and calculate mean and STDEV. Start milk volume at mean consumption volume + 6*STDEV and fill up to that level every day. Would require a pretty outlandish black swan milk event to exhaust milk volume (Toddler mega party) or include toddler mega party for calculation of mean and STDEV. Make the door clear (glass) stop drinking milk... This is easy - Take an electronic weigher, connect it to an RaspberryPI, program a Python script to auto order the milk (via WiFi) from a delivery service when it hits a specific weight... but wait, this is Microsoft! Got Milk? Put the Milk in the fridge and lock the fridge so that no one can open so "Milk will be always in the fridge :-)" as no one can take it out. |

### Software Engineer at Raytheon was asked...

In front of you are three light switches. Only one does anything, and it turns on the light downstairs. From here you can't see the light, and it makes no sound. You must determine which switch operates the light, BUT you can only go check it once. How do you figure out which switch is for the light? 26 AnswersFlip any switch you want. Wait for about 5-10 minutes to let the bulb heat up. Flip that same switch off, and another one on. Go check the light. If it's off and hot, it was the first switch, if it's on it was the second and if it's cold and off, it was the last one. flip one switch look down stairs with out going down stairs and look if there is any light. Continue this until you see the light. flip them all on. only one does anything so the other two really doesn't mean anything. Show More Responses Flip the switch on one end, wait a "long" time (e.g., 15 minutes); then flip the middle switch; them immediately go check the light for on/off status and temperature. If off: the switch you didn't change controls the light; If on and surrounding fixtures slightly warm, the middle switch controls the light; If on and surrounding fixtures fully warm of hot, the first switch controls the light. The first answer is right of course. Most of the other answers would make the interviewer realize you don't listen, don't understand the question, or don't care. Either way, not what you want in an interview. Don't jerk around. I frankly enjoy all the wry responses! Because this is just one of many ridiculously shallow and pointless interview questions that reveals much more about the intent and competence of the interviewer rather than the interviewee. Preparing for and sitting through an interview is tense enough - so it is totally deflating when a "gotcha" question like this is thrown at you. When I hear a question like this during an interview, I immediately know that the interviewer is 1) incredibly lazy and 2) clueless about how to actually gather worthwhile information in order to make an informed decision. Is that person someone you would want working with/supervising you??? Use solution one. Then use the light to get out - unless downstairs is the switch to fire the HR Department. I do like the use "an electrical tester" answer - unless you're interviewing for a safety job. Use solution one. Then use the light to get out - unless downstairs is the switch to fire the HR Department. I do like the use "an electrical tester" answer - unless you're interviewing for a safety job. Collins has the answer - Flip all 3 switches send your helper downstairs to let you know when the light turns on and off. LOL...good luck tripping and stumbling while looking for the warm light bulb in the dark! Turn all three switches on. The flip one switch off at a time and check to see if the light goes off after flipping that switch off. When the light goes off...that was the switch. oops! can only check it once. I dont get the job because I cant follow directions...If i'm in charge of the project, I can check it as many times as I like!!! Take the faceplate off and look inside to see which switch has wires hooked to it. That would be the winner. Show More Responses It does not have sense because I am not an electrician. So I can flip any switch, after few minutes flip once again this switch and any other and go check to bulb. If it will be dark I can not check anything because I can not find the bulb I it will be light it does not mater which switch operate. I can go forward, :) I'll take the job. I can think of several solutions. I like these questions. And they are not pointless. How you answer such a question, or how you attempt to do it shows ho imaginative you are and whether you persist. A few possible solutions: 1. If it is dark outside, or the building does not have windows, operate the switches one at a time until you hear angry voices from downstairs - nobody likes to stay in the dark. 2. Otherwise, operate the switches one at a time and ask the people downstairs. 3. Do not operate any switch. Take your light-detecting sensor downstairs. The sensor transmits a wireless signal to the receiver in your pocket. Get back to the panel and start flipping the switches until you get the signal from the receiver. 4. Take your bow and three arrows with dull heads (you do not want to damage the switches). Go to a place from where you can see both downstairs and the panel. Start flipping the switches one by one by shooting arrows at them. 5. You need a big fly - one of those you can hear flying. Turn off all the lights in the building. The lights must be on only at the place where you stand and downstairs. Have someone release the fly downstairs - you can hear it buzz. Start flipping the switches one a time and wait. You know you got the right switch when you stop hearing the fly (or when it comes to you). Ask someone to go downstairs and yell up to you when it works. What are you people mentally challenged? You have no way of knowing which switch controls the light. The "correct" answers above assume the light is initially off. If the light started out as on and you performed this test you would get misleading results. I would either ask someone on the team who already knows which light switch it is or I would search the Internet for the solution to figuring it out on my own. I like the answer about requesting someone to go downstairs and check the light while you flip the switch, it shows 3 things about you: #1-You're not afraid to ask for help when needed. #2- It shows you can delegate. These responses coincide with TEAMWORK. Unless the interviewer has specifics, in which you ask. That could be the #3rd answer-BEING RESOURCEFUL by asking questions. It shows your interest in the job and you don't have to be an electrician to figure it out. subduejoy clearly has the answer, it's what I do for most of my problems. The "temperature" method is clever but that assumes the lights are incandescent and you're close enough to the bulbs that you can get there before they cool down to room temperature. An interviewer might look at that answer as clever but wrong because you make assumptions that weren't explicitly allowed (Microsoft would probably say this). My answer would either be. a) Ask for help (shows you not afraid to be a team player b) Do it the electrical engineering way and put a video camera in the room and wait 15 minutes before flipping each switch. It's really a stupid question though that says nothing about how good of an employee you'll be. 1. Flip one switch 2. wait 2 minutes 3. Flip switch off again 4. Flip another switch on 5. Immediately go downstairs and check if a light is on If the light is off, the switch you flipped in step 4 is not correct. 6. Touch the bulb If the bulb is cold, the switch you flipped in step 1 is incorrect. That means that the remaining switch is the correct choice. If the bulb is hot, the switch you flipped in step 1 is the correct choice. Tell the HR interviewer to go stick his/her finger in the light socket and scream when you flip the correct switch. Show More Responses On a multiple unit switch the farthest left is often the first to be hooked up, Open the switch plate, using an electrical tester- test for the live wire. Only one will test positive. Flip switches, keep checking, at the foor of the stairs, until you see light; that will be the switch! |