# Brain teaser Interview Questions

interview questions shared by candidates

## Brain teaser Interview Questions

You have a birthday cake and have exactly 3 slices to cut it into 8 equal pieces. How do you do it? 36 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. |

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

How far apart is the hour and minute hand a 3:15? 5 Answers7.5 degrees 360 degrees on the clock. Each number is 360/12 = 30 degrees apart from one another. at 3:15, the minute hand is at 3 while the hour hand is 15/60 = 1/4 away from 3. So (1/4) * 30 = 30/4 = 7 + 2/4 = 7.5 degrees The previous two answers are incorrect. If it is 3:15, the hour hand and minute hand are in the same orientation. Therefore they would be 0 degrees apart. Show More Responses No matter what time of the day, the minute and hour hand are always touching in the center of the clock face. Is that 3:15 a.m or p.m.? |

What is your idea of reasonable turn around time for a project? 3 AnswersDepends on the clients ability to provide assets, and the scope of work. Reasonable would be the projected, based on original scope and estimated labor hours. The word reasonable in itself indicates the use of reason to determine the outcome. Just |

How would you handle a situation where you have a client who interrupt your existing interaction with a client? 2 AnswersI request the existing client to step aside momentarily which I then assess all my available resources to assist this client. Should it then become heated I attain a manager to resolve the situation. I politely tell the client who interrupted to please standby and that I will be able to answer their questions/handle their issues shortly. If they need immediate attention I will call a member of the team to assist. |

Q2: A pnp transistor with its base connected to a voltage source, the V source is connected to a +10V source. The emitter of the transistor is connected to a resistance, and then to the same +10V source. The collector side is connected to a capacitor, which is not charged at t=0-. Given the graph of Vsource = 10 V stepping up at t = 0 to further, draw the graph of Vout. Vout is between the point of collector and capacitor. 3 AnswersANS: Vout should be constantly -10V until t=0, and will hit V=0 V linearly from V=-10 V after t=0. Hi, Can you explain why it linearly increases? Are you assuming that Collector is tied to -10V? The pnp transistor is completely cutoff for the given biasing. The only way the capacitor is going to charge is through leakage currents. It is very slow and takes a lot of time. Please advise me if my analysis is correct. I just made it back from Lutron's HQ and I was asked for the same question. My first approach will be identifying a PNP BJT, and elaborating all 4 BJT operating regions. Before t = 0, since q = 0, by using Q = CV, we can tell that the voltage across the capacitor is 0. Hence, Vo = -10V before t = 0. Recall the capacitor's current equation: I = C*(dv/dt), we can solve for the slope of changing voltage -> dv/dt = I/C. Here, I is simply the BJT's collector current, which can be found by looking at the BJT's emitter current. Given that the (beta) parameter is infinite, we see the base current to be 0. Now, at this point, we need to look for I_E. Since the R is given to be 9.3k, and VEE = 10V, it is natural to assume V_EB = 0.7V, and thus the voltage across R = 9.3V. Therefore, I_E = 9.3/9300 = 1mA. Voila, we now values for all currents: I_E = I_C = 1mA, and I_B = 0A. Plug the I_C value into the equation: I_C/C = dv/dt (C = 1uF). We know that the slope of the voltage change is 1000V/second, or 1 Volt per millisecond. Now, we know the capacitor voltage raises at 1V/ms from -10V, but we also need to know where is the upper limit. Looking back to the BJT basics about operating regions and BJT's 2-diode model, it is not hard to identify that this PNP BJT must operate in "Saturation" region (NOT IN "ACTIVE" REGION!). The boundary of that region is V_BC <= 0.7V (I hope everybody is able to solve for this). Hence, 0.7V will be the upper limit for capacitor voltage. At this point, you will have a flat line at Vo = -10V before t = 0. and raises at 1V/ms for 10.7ms and hit Vo = 0.7V. From t = 10.7ms and on, the Vo stays at 0.7V. |

### Systems Analyst II at AT&T was asked...

How would you respond to a customer who encountered a problem with a product or service. 1 AnswerFirst, try and reproduce the problem and if the problem could be reproduced acknowledge there was an issue, give thanks for bringing this to the company's attention, and apologize for the customer's encounter with the issue. Offer possible solutions or workarounds while the team worked to correct the issue. |

### 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 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. It can be just one game. A huge mock battle. Show More Responses 5,622. Assuming it is a single elimination tournament. All teams lose one game except the champs. It's always # of teams - 1 if each team plays until it loses in one(team)-on-one(team) contests, the answer is ln(5623)/ln(2) 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. 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. There is no true answer as the question is very open ended. The interviewer is probably looking at task delegation, management and creativity skills. One One. Obviously. One game, all players participate. If participants equal number of teams involved, think power of 2. Show More Responses 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 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 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. 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. 5622 ... if based on elimination between 2. Show More Responses 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! Depends on the numbers of players per team. '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. Show More Responses 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".... 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! 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. None. Our PC world demands everyone gets a trophy. ********************* 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. 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. What kind of tournament? 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. One 2 The simple answer is Number of Teams minus ONE. Simplified, a four team bracket plays 3 games. |

### 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. 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). 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. Show More Responses 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. 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! 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. 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! 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. Show More Responses 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 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. "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." 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. |