Microsoft Interview Questions and answers-abnormal but classic (answer)

Source: Internet
Author: User

From: http://topic.csdn.net/u/20070315/10/78d03595-b5fa-4853-ab02-37ed16c2ddb3.html

Answers to the first group:

1) three ropes, the first ignition, the second ignition, and the third ignition

After the first rope is burned (30 minutes), the other end of the second rope is ignited. After the second rope is burned (45 minutes), the two ends of the third rope are ignited, timing is complete after the third rope is burned (1 hour 15 minutes)

2) According to the drawer principle, four

3) 3 litre fill; 3 litre-> 5 litre (full injection); 3 litre fill; 3 litre-> 5 litre (1 litre left); 5 litre fill; 3 litre-> 5 litre (1 litre for injection); 3 litre for filling; 3 litre-> 5 litre for filling; done (also: programming with Backtracking Method)

4) one of them asked: Which one would the other say is to be honest? The road pointed by the respondent must be directed to the lying state.

5) 12 balls:

First time: 4, 4 if it is flat:

In the remaining balls, Set 3 to the left and 3 to the right:

If the left side is heavy, take two balls to name them. Which one is secondary, and the third one is secondary, Which is light.

If the product is flattened, the next defective product can be called as needed, which is lighter or heavier than the genuine product.

If not:

You may wish to set the weight on the left to the right. For convenience, the four on the left are called the weight, the four on the right are called the light ball, and the remaining four are called the good ball.

Take two duplicate balls, two light balls on the left, and three good balls and one light ball on the right.

If the left side is heavy

It is called the two heavy Balls, a secondary product. If it is flat, the right side of the secondary product is light.

If the weight on the right is

Two light balls on the left, one light product

If

It is said that there are two remaining secondary products with heavy weight, and the remaining secondary products with light weight will be flat.

13 balls:

First time: 4, 4, if the Ping

The remaining five balls can still be used to identify defective products, but the defective products are light or heavy.

If not, same as above

6)

O

O

O

7)

23 times, because the minute-hand has to turn around 24 times, the hour-hand can turn around 1, and the interval between the minute-hand and the hour-hand coincidence is obviously> 1 hour, they have 23 chances of overlap, there is a coincidence opportunity for the second point in each duplicate, so it is 23 times.

The coincidence time can be determined by reference to the watch, or by column equation.

8)

Plant trees on the Earth's surface and build a positive triangle that is connected to the Earth.

The second group has no standard answer

Group 3

1. divided into 1, 2, 4, the first day to 1, the second day to get 2 1, 3rd days to 1, 4th days to get 4 1, 2, 5th days to 1, 2 For 6th days. 1 for the seventh day.

2. determine the time when a train encounters. The bird's speed multiplied by the time is the distance from the bird's flight.

3. Take 1, 2, 3, and 4 pills in the four cans respectively to determine the weight of the medicine in the jar.

4. three switches are respectively: Turn off, turn on, turn on for 10 minutes, then enter the room, dark and cooling switch 1 control lights, light switch 2 control lights, dark and hot light for Switch 3 Control

5. Because, can be combined into any required currency value, the daily habit is 10 hexadecimal.

6. Do not understand the meaning of the question ...*_*

012345 0126 (9) 78

The fourth group is a difficult topic.

Question 1: 97 0 1 2 0 or 97 0 1 0 2 (Tip: Use the reverse method to obtain)

Question 2: five flights, Method 2:

The three ABC racks take off at the same time, and C fill AB with oil, c Return, 1/8, B fill a with oil, B Return, and a reach 1/4, c. Take off from the airport to the other direction. For example, C is equal to a of the empty fuel tank. For B, take off from the airport. For AC to 3/4, the remaining fuel is equal to B, three planes return at the same time. So it was five flights. Question 3: mathematical models need to be created

(Note: It is difficult to strictly prove the optimal model, but it is indeed verifiable. bold conjecture is the key to solving the problem)

The question can be attributed to the number of series an = 500/(2n + 1) n = 1000, 2, 3... and when is the sum of Sn and n greater than or equal?

When n = 6, S6 = 977.57

Therefore, the distance between the first vertex and the starting position is 1000-977.57 = 22.43 kilometers.

So before the first transit, a total of 22.43*(2*7 + 1) = 336.50 liters of oil consumed

After that, each transit consumes 500 liters of oil

Therefore, the total fuel consumption is 500 + 336.50 = 3836.50 liters.

Question 4: mathematical models need to be created

The question can be attributed to finding out when the natural sequence and S are greater than or equal to 100, and solving n> 13

The floor of the first cup may be: 99,100

Question 5: 3 and 4 (strictly proven)

Set the numbers to N1, N2, N1> = n2. The numbers heard by a are n = N1 + N2, and the numbers heard by B are m = N1 * N2.

It proves that n1 = 3, n2 = 4 is the unique solution.

Proof: To prove that the preceding proposition is true, prove n = 7 first.

1) necessity:

I) n> 5 is obvious, because n <4 is not possible. N = 4 or n = 5 cannot answer n.

Ii) n> 6 because if n = 6, although Jia does not know (not sure whether 2 + 4 or 3 + 3) however, no matter whether it is or, it cannot be said that you do not know (M = 8 or M = 9 if B does not know it is unreasonable)

Iii) n <8 because if n> = 8, N can be divided into N = 4 + X and n = 6 + (X-2 ), then M can be 4x or 6 (X-2) and 4x = 6 (X-2) the necessary condition is X = 6 that n = 10, in this way, N can be divided into 8 + 2, so when n> = 8, n can at least be divided into the sum of two different composite numbers. When B does not know, A has no reason to immediately know.

The above proves the necessity

2) Adequacy

When n = 7, N can be divided into 2 + 5 or 3 + 4.

Obviously, 2 + 5 does not match the meaning of the question, and it is easy to determine that 3 + 4 matches the meaning of the question, M = 12, and the proof is complete.

Therefore, n = 7 m = 12 n1 = 3 n2 = 4 is the unique solution. Question 6: 7 (mathematical induction)

1) if there is only one sick dog, because the sick dog owner cannot see any other sick dogs, he must know that his dog is a sick dog (provided that there must be a sick dog ), so he will execute the sick dog on the first day.

2) if K dogs are set up, they will be executed on the K-day. If k + 1 dogs exist, the master of the dog will only see K healthy dogs, on the K Day, no one killed the sick dog. The master of the sick dog knew that his dog was a sick dog on the K + 1 day, so the sick dog was executed on the K + 1 day.

3) from 1) 2) If n dogs are ill, they must be executed on the nth day.

Question 7: (Tip: it can be solved using graph theory)

Bono & edge (2 points), Bono (1 point), Adam & Larry (10 points), edge (2 points ), bono & edge over (2 points) 2 + 1 + 10 + 2 + 2 = 17 minutes

Question 8:

Agree on a person as the speaker (it can be the first person to let the wind go)

The rules are as follows:

1. When the reporter turned on the light, and the number of times the light was turned on

2. When others first turn the light off when the light is turned on

3. When the reporter turned on the light 100th times, he reported to the prison director and asked the Director to release the light ......

According to the probability, they can be released after about 30 years (10000 days ).

No standard answer in group 5

For the sixth group of questions, refer to the answer:

4.

Char * strcpy (char * pstrdest, const char * pstrsource)
{
Assert (pstrdest! = NULL) & (pstrsource! = NULL ));
Char * pstr = pstrdest;
While (* (pstrdest ++) = * (pstrsource ++ ))! = '\ 0 ');
Return pstr;
}

5.

Char * strrev (char * pstr)
{
Assert (pstr! = NULL );

Char * P = pstr;
Char * pret = pstr;
While (* (p ++ )! = '\ 0 ');
P --;
Char TMP;
While (P> pstr)
{
TMP = * P;
* (P --) = * (pstr );
* (Pstr ++) = TMP;
}
Return pret;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.