Google interview questions - and answers (rpm)

Transfer: http://article.yeeyan.org/view/103880/69771

1) The village has 100 couples, each without the knowledge of her husband his wife having an affair. . . Each wife in the village can immediately find other men other than her husband of having an affair if, except I do not know her own husband in the end there is no betrayal. The village rules intolerance adultery. Any wife, once able to prove himself a man having an affair, you must kill him that day. Women of the village all do the same strict rules and practices. One day, out of female leaders announced that the village has at least a cheating husband. May I ask what will happen next?

Answer: (a reader Olivier Coudert provided)

This is a typical recursive problems. Once all the wives know at least one man derailed, we can recursively to look at this process. Let us assume that only a cheating husband. His wife is having an affair did not see any man, so know this person is her husband, she would have killed him that day. If there are two cheating husband, the wife he only knows that her husband is not a man having an affair. So she would wait a day saw that person has not been killed. If the first day no one was killed, she can determine her own husband stole situation. And so on, if there are 100 husband having an affair, then they can safely live for 99 days until 100 days, all the wives kill them all.

Job: Product Manager

2 ) the assumption on some highway, 30 within minutes after the car saw the probability is 0.95 . Then, in 10 probability of passing cars to see within minutes is how much? (Assuming that the probability of default fixed)

Answer: (a reader ru provided)

This is the key problem is that 0.95 is the probability of seeing one or more vehicles, not only to see the probability of a car. In 30 within minutes and did not see any vehicle probability is 0.05 . So 10 did not see the probability of any vehicle within minutes is the cube root of this value, and in 10 probability of seeing a car within minutes, compared with 1 subtracted cube root, which is about 63% .

Job: Product Manager

3 ) There are four people to cross a suspension bridge back to the camp at night. But they have only a flashlight, batteries and then only enough to light 17 minutes. The bridge must have a flashlight, or too dangerous. Bridge can only carry a maximum weight of two people to pass. The four men are not the same speed of the bridge: a need for 1 minute a need for 2 minutes, and a need 5 minutes there is a need for 10 minutes. How can they 17 all cross the bridge within minutes?

Answer: (provided by the anonymous reader)

1 and 2 together through ( 2 min); 1 returns ( . 3 minutes); 5 and 10 together through ( 13 is min); 2 return ( 15 min); 1 and 2 together through ( . 17 min). All safe bridge.

Job: Product Manager

4) You and a friend to the party. Party you count a total of 10 people. . . Your friends want to play with you a bet: You and each of you find a birthday the same in these people, you win a dollar. He and your birthday each find a different person these people, he would win 2 dollars. You should not play this bet?

The answer: not a leap year, then others with your same birthday probability is 1/365 ; your birthday with a different probability is 364/365 . So do not call this bet.

Job: Product Manager

5 ) If you see the clock above time is 3 : 15 , so that the angle between the hour and minute hands is how much? (The answer is not zero)

Answer: (a reader Matt Beauchamp provided)

7.5 degrees. The clock every minute is 6 degrees ( 360 degrees / 60 min). Go to the next digit hour per hour from a number (in this example from . 3 point . 4 points), i.e. 30 degrees. Because this question came just in time 1/4 hours, so the hour hand has completed 30 degrees 1/4 , which is 7.5 degrees.

Job: Product Manager

6 ) The folded into a wooden 3 after the segment , the probability of a triangle can be formed much?

Answer: Since the title is not required, said wood to be connected end to end to make a triangle, and therefore the answer is 100% . Any length of three strips of wood may be formed a triangle.

Job: Product Manager

7 ) South Africa has a latency problem. Please analyzing them.

Answer: This is obviously a very vague question, so there is no single correct answer. Good answer should be by interviewing those who demonstrate their familiarity with the "delay" concept and play to their imagination, devised an interesting question and a delay of interesting solutions to its offer.

Job: Product Manager

8 ) I have three points not in a straight line on a two-dimensional plane. You will be able to make a few points with the same distance line?

Answer: (a reader Denis provided)

Three. The joint between the two points as a segment. In the middle position between this segment and the third point, to make a straight line parallel to the line segment, i.e. a three-point equidistant from the line. Then the rest of this method of combination of the other two points to be made.

Position: Software Engineer

9 ) 2 of 64 power is how much?

Answer: If you are not for sitting in the interview room, do not have a calculator, it should be easy to find the answer, that is 1.84467441 multiplied by 10 of the 19 th power.

[If I, write a 1 , followed by 64- zeros, regarded 2 binary answer, ha ha. - Translator's Note]

Position: Software Engineer

10 ) Assuming you covered shirt in the closet, it is difficult to pick out some one. May I ask how you plan to tidy up, making them easy to pick?

Answer: This question is no fixed answer. The test of the interviewee imagination and creativity in solving problems. We feel that the reader "Dude" is the answer might give Google impressed: they hash (according to the type of fabric HASH ) combination. Then press each class 2-3-4 tree or red-black tree (both computer algorithms) order.

Position: Software Engineer

11 ) gives you a Tic-tac-toe ( Tic Tac Toe ). . . You write a program for the entire game and the player's name as a parameter. This function needs to return to the game results, that is, whether this player wins. First you have to decide what kind of game processing data structures. You have to talk about what the algorithm to use, and then write the code. Note: this game is some of the grid may be empty. Your data structure needs to take into account this condition.

Answer: (by readers of "Dude" provided)

The required data structure is a binary number of characters should be included. Calling this function checks 6 two conditions to determine whether there is a winner. The first of 6 two conditions is to see whether there is space. If there is a winner, then determine whether the player character is X or O . So you need a flag. If there are winners this value is returned and the end of the game, if not then continue the game.

Position: Software Engineer

12 ) is 1 Wanyi number of sorting how long? Say a reliable estimate.

Answer: This is not a standard answer questions. The purpose is to investigate the creative interviewee. We tend to answer two simple given the reader: The Merging Sort ( Merge the Sort sort). An average case O (1,000,000,000,000 the Log 1,000,000,000,000) . In the worst case is O (1,000,000,000,000 Log 1,000,000,000,000) [both are the same. - Translator's Note]. You can now do one billion operations per second, it should require approximately 3000 seconds.

Position: Software Engineer

13 ) Please design a "leapfrog" game algorithm, and write code for the program. . .

Answer: The goal of this game is to guide a frog to avoid passing traffic, crossing a busy road. You can use a number of columns to represent one lane. Be reduced to one embodiment N highway lane. We found only one answer to this question, it comes from Glassdoor.com website: "One way is to write a recursive algorithm to determine when to wait and when to jump into the next lane by the lane that if there are gradually approaching. obstacles to decide. "

Position: Software Engineer

14 ) Google Resume How many software engineers receive each year? It also has the ability to examine whether the candidate of the questions simple and clear, and come up with creative solutions.

The answer: a job seeker "quantitative analyst reward" jobs, should know that 2008 Nian Google employs 3400 people. It estimated that 75% of that 2550 people, should be engineers, and Google and Harvard acceptance rate similar to that taken from the applicants by 3% . It can be seen to be received approximately 85,000 CV ( 85000 = 2550 X. 3% )

Position: quantify compensation analyst

15 ) gives you a numeric list. . . After coming to an end list will start from scratch (circular list). Please write the most efficient algorithm to find the minimum number of the list. Identify any given number in this linked list. Digital list is always growing, but you do not know where to begin circulating the list. Example: 38, 40, 55, 89, 6, 13, 20, 23, 36.

Answer: Our favorite answer from reader "Dude" : establish temporary pointer and start from the root. (In most cases have circular list forward or backward pointer.) Analyzing more forward or more rearward. If you know more forward has reached the final list, the list again located in the starting position. If more forward [sic], it seems should be "forward smaller." - translator's note], you can search backward and compare numbers. If neither root nor a pointer to the list, then your data is lost in the memory.

Position: quantify compensation analyst

Guess you like

Origin www.cnblogs.com/w4ctech/p/11788291.html