Microsoft programmer test questions

xiaoxiao2021-03-06  118

Original: Onefi http://www.frontfree.net/2003 June 1

I recently saw a lot of Microsoft test questions on the website and attracted a lot of eyes. I am here to organize all test questions, then attach my answer. (A variety of individual questions, text only represent the author's ideas, if you have high welcome and me

OneFi@frontfree.net) gives a time after each question. This time is the time I have used in this question. (Note, this is not a standard time, I believe that all friends who browse this test paper will find inspiration, quickly solve the problem on a certain or more questions.

One. The most basic questions (description: This type of problem is relatively simple)

1. Burn a non-uniform rope, which takes an hour from the head to the tail. Now there are several ropes as the same material, ask how to use the ro turns to time a 10th minute fifteen minutes? (This question I originally thought about an hour) 2. You have a bucket of jelly, including yellow, green, red, close your eyes, grabbing two colors. How many can you determine if you have two simultaneous jelly? (5 seconds - 1 minute) 3. If you have an endless water, a 3-liter hit, a 5 liter, the shape is uneven, ask you how to accurately say 4 liters Water? (40 seconds - 3 minutes) 4. One fork intersection leads to honesty and lie. Two people have been known, known as honesty, the other is to talk about the lie. Honest is always truth forever, and the lies will always talk forever. Now you have to talk to the country, but I don't know which path you should go, you need to ask these two people. What should I ask? (20 seconds - 2 minutes) 5.12 balls one balance, now I know that only one and other weights are different, ask how to find that the ball can be found three times. 13? (Note that this question does not indicate that the weight of the ball is light, so it needs to be carefully considered) (5 minutes - 1 hour) 6. Posted 10 straight lines in 9 points, requires at least three points on each line? (3 minutes - 20 minutes) 7. How many times when the clock is compacted in 24 hours a day, when the clock is completely coincided with the clock? What time is it? How do you calculate it? (5 minutes -15 minutes)

two. There is no answer (note: These questions are obviously not taking your intelligence. The test is your ability to respond. This problem has no answer, but you have to look at your reaction!)

1. Why is the cover of the waterway? 2. How many cars have? 3. Insert the car key into the door, rotate in which direction can be opened? 4. If you want to remove any one of China's 34 provinces (including autonomous regions, municipalities and Hong Kong and Macao Special Zones and Taiwan), why? 5. How many gas stations can meet all China's car? 6. Imagine that you stand before the mirror, please ask, why do you have an image in the mirror to reverse it, but can't you reverse it? 7. Why is you in any hotel, you will open hot water, hot water will pour in an instant? 8. How do you explain Excel's usage to your grandmother? 9. How do you re-improve and design an ATM bank ATM card? 10. If you have to re-learn a new computer language, how do you plan to start? 11. If your career plan is planned to be rewarded within 5 years, what is the motivation for this reward? Who is the audience? 12. If Microsoft tells you, we intend to invest five million US dollars to launch your investment plan. What kind of business plan will you start? why? 13. If you can collect the computer vendors of the world in an office, then tell them will be forced to do something, what will this matter? three. Puzzle (Description: This type of question is certain, if you can't get the answer, you can't explain what you think about the question, then the answer will come out soon. If you can't think about it, then ... Don't want to solve it. .)

1. You let the workers work for 7 days for you, returning is a gold bars, this gold bars are divided into seven segments, you must give them a gold bars at the end of each day. If you only allow you to break the gold bars twice, how do you pay for your workers? 2. One train leaves Beijing to Beijing from Guangzhou, at the speed of 15 kilometers per hour, and another train is from Guangzhou to Beijing at the speed of 20 kilometers per hour. If there is a bird, start at the same time and the two trains at the same time, starting from Beijing, returning to the opposite direction after touching another car, so it is in the two trains. Flying until the two trains meet. Excuse me, how long is this bird fly? 3. You have four pills, each pill has a certain weight, the contaminated pill is the weight of the pills that are not contaminated. Only weigh one time, how to determine which can the medicine is contaminated? 4. Three switches outside the door correspond to the indoor three lamps, the line is good, and the indoor light cannot be seen when the switch is controlled outside the door. Now it is only allowed to enter the door, determine the corresponding relationship between the switch and the lamp? 5. Why is the renminbi only have a face value of 1, 2, 5, and 10? 6. You have two jars and 50 red playballs and 50 blue playballs, randomly select a jar, randomly select a play ball into a jar, how to give the biggest chance of red playball? What is the chance of getting the red ball in your plan?

four. Super-difficult (Description: If you see this question for the first time, and I have never seen a similar type of topic, and I can make an answer within half an hour. I can only show your intelligence. ...

The first question. Five pirates grabbed 100 gems, each is the same size and value in the city. They decided to say such a minute: Draw a lot to determine his own number (1, 2, 3, 4, 5) First, the allocation scheme is proposed, then everyone vote, when and only more than half of the people agree, according to his program Allocation, otherwise it will be thrown into the sea, if the shark is fed, after the death, then the distribution plan is proposed, then the remaining 4 people will vote, and when and only more than half of the people agree, according to his program Otherwise, it will be thrown into the sea to feed shark accordingly: Every pirate is a very smart person, it can be reasonable to make a judgment, so choose. Question: What distribution plan is the first pirate to maximize your income? The second question. A problem about the plane refueling, known: Each plane has only one fuel tank, and the aircraft can be refueled to each other (note that it is mutual, no fuel machine), which can provide a plane to the earth to fly a half circle, Question: In order to make at least one aircraft returned to the plane of the airport, at least a few aircraft needed? (All airplane take off from the same airport, and must be safely returned to the airport, not allowing the midway to land, there is no airport in the middle)

Fives. Subjective (Description: In the future work, we will definitely make such a mistake. Since the error has been made, the loss is inevitable, we can only find ways to reduce the loss to the smallest. If you can quite answered These problems, if there is a mistake, it can make customers have the least complaint, the company has the least loss.)

1. A mobile phone manufacturer may cause battery life than the original design of the battery life than the original design, the solution is free to replace the battery or purchase 50 yuan to purchase the manufacturer's new mobile phone. Please write a letter to all purchased users to tell the solution. 2. A high-level leader is visiting a museum, and a small king of Ming Dynasty as a commemoration of the museum, according to the state, anyone may not change the museum collection into private. How does the museum curator need to write a letter to this leader and take the city brick back. 3. Miss Salesperson, due to the business mistake, will sell the laptop of 20,000 yuan to Mr. Li, Miss Wang's manager, how to write to Mr. Li trying to return money?

Sixth. Cases of the questions (notes: These questions are not a trick, the test is how your basic knowledge. People who are smart and no real studies will be eliminated by these questions.)

1. Where is the difference between the linked list and array? 2. Write an algorithm for realizing the sort of linked lists. Explanation Why do you choose this way? 3. Write an algorithm for implementing array sorting. Explanation Why do you choose this way? 4. Please write code that can directly implement the strstr () function function. 5. Write procedures for reverse strings, require optimization speed, optimize space. 6. How do I find a loop link in the list? 7. An algorithm for the shuffle and store the washed card in a plastic array. 8. Write a function, check if the character is an integer, if yes, return its integer value. (Or: How to prepare a function of a string to long plastics with a 4-line code?) 9. Give a function to output all the arrangements of a string. 10. Please write the same code as the malloc () memory allocation function. 11. Give a function to copy two strings A and B. The first few bytes of string A overlap the first few bytes of string b. 12. How to write a program and put a ordered integer array in the binary tree? 13. How to print the binary tandem data layer by layer from the top? Please program. 14. How to drop a chain list (that is, in the order, pay attention to the boundary conditions of the linked list and consider the empty list)? Solution and Tips:

Note: The answer is what you think, it doesn't mean the correct answer. If you have a friend to find an error, or know a better answer. Don't forget to learn: onefi@frontfree.net

One. Most basic topic

1. A burn from two heads and starts with any one from the middle. After burnt, it is fifteen minutes. Then it is one hour. 2.4. 3. Slightly ... 4. If you participate in the Olympic mathematics class, you should have done these questions. Ask him how your country will go, he is sure to point to honesty. 5. Slightly ... 6.7.11 times (I think so)

two. No answer

1. The round well can't go down to 2.10 million (I think so) 3. I will answer the clockwise direction. 4. Beijing. (The reason is that I was born in Beijing in Beijing, I want to let Beijing to see it because I want to see the outside world. Since Americans ask our political issues, we will respond to a political joke) 5. 100,000 ( You can create nearly one million jobs) 6. The answer is "this feature is by design." If the examiner is required to give a more reasonable explanation, he said to him: "If you have more questions about this problem, please Contacts with its supplier (or with its inventors). 7. If you don't pour, this hotel will not live. (So ​​this problem is best to ask the boss of the hotel.) 8. Tell her this is the most advanced thing, she doesn't need to do it, I will help her. 9. I want Spielberg to answer this question, it is not yet. 10. I think the playback of the flying net is more suitable for half a month. 11. I have no idea of ​​this question, because there is no work experience, so I didn't understand what he asked! 12. Make Microsoft OEM, which can better serve Microsoft. 13. Integrate the host box in a LCD monitor!

three. problem

1. Sliced ​​two knives, divided into 1/7, 2/7, 4/7. 1/7 on the first day; 2/7 for the next day, I want to go back 1/7; I will give 1/7 on the third day; 4/7 for 4/7 in the fourth day, I have to come back 1/7 2/7; Give 1/7; give 2/7 for the sixth day, will be 1/7; give 1/72 in the seventh day. So far, I don't know how to answer. 3. Remove 1, 2, 3, 4 pills from four jars, don't say it! 4. Open one first, take a long time. Then turn it off and open another one. Going out, the one that is bright is not to say. The remaining two are not bright, and it is judged according to the temperature of the bulb. 5. So far, I don't know how to answer. 6. Unclear. May be 50%. Four. Ultra-difficult

You can go to the forum in the technology network www.frontfree.NET to see, there are many masters still discuss this problem ... I have asked a lot of people. No one's answer is very satisfactory. Looking forward to the appearance of the master ...

5. Subjective

1. Tell the user that our company will appreciate the customers for a long time, customers can replace a new battery for the original battery for the original battery. Or you can purchase an invoice, get 50 yuan to purchase the manufacturer's new mobile phone. 2. The letters are as follows: "XXX Leaders: Hello! Our venue will show a group of precious cultural relics in the near future, so that more people can truly understand the long-standing and splendid of the Chinese national civilization. We hope to have the Ming Dynasty you have The city brick is exhibited. And we will set columns in the museum to promote your huge contribution to the preservation of the Chinese nation, so that more Huaxia children have seen, and experience the long history of Chinese civilization, thus Strengthen the cohesiveness of the Chinese nation! "Explanation: After the leaders have seen this letter, if you don't take out the city tile. Then explain that he doesn't want more people to see the splendid civilization of the Chinese nation, and do not want the Chinese nation to have stronger cohesiveness. Naturally, I will take out the city tile. If the leader is asked when the leader is exhibited, I can tell him that the museum wants to be permanently exhibited, and the leaders naturally have nothing to say. 3. The letters are as follows: "Dear customers, hello! Due to the staff's mistakes, you can sell a sample machine to you. In order to better use our products, our company decided to replace the same price for free One notebook. And we have a more cost-effective XXXII laptop, priced at 20,000 yuan. If you purchase, we will sell in 19,000 yuan. "

six. Algorithm, please refer to the data structure and computer algorithm class, the author will no longer copy the book.

Attachment (1): Summary of burnt rope problems: The rope given is not uniform. If one hour is one hour, the calculation method of half an hour is to burn from two heads. The fifteen-minute calculation method is from two heads, while starting from any place in the middle, so that this rope has four burning points, time is naturally a quarter of the burning point. If you calculate ten minutes, let the rope have six burning points, the method doesn't have to say it!

Attachment (2): Balance Weighing Problem Solutions and Summary: Take the ball into A B C D; E F g H; I J K L.

First weigh, compare abcd efgh

Situation 1: The two weights are equal, and the answer is in IJKL. Weigh IJ, if equally, the answer is in KL. Take K and A comparison, if equally, the answer is L; if it is not equal, the answer is k. If not, the answer is in IJ. Take I with a Compare, if equally, the answer is j; if it is not equal, the answer is I.

Situation 2: ABCD light. Remove the FGH in the EFGH, replace the BCD in the ABCD. Remove the JKL in ijkl, supplement it to the original FGH position. If the AFGH is light, the answer is A or E. Weigh AB, if equally, the answer is E; if it does not wait, the answer is A. If AFGH is heavy, the answer is described in the FGH. Weigh fg, if equally, the answer is h; if it is not equal, the weight is the answer. If you are as heavy, the answer is in the BCD. Weigh BC, if equally, the answer is d; if it is not equal, the light is the answer. Situation three: ABCD is heavy. Remove the FGH in the EFGH, replace the BCD in the ABCD. Remove the JKL in ijkl, supplement it to the original FGH position. If AFGH is heavy, the answer is A or E. Weigh AB, if equally, the answer is E; if it does not wait, the answer is A. If AFGH is light, the answer is in FGH. Weigh FG, if equally, the answer is h; if it is not equal, the light is asked. If you are as heavy, the answer is in the BCD. Weigh BC, if equally, the answer is D; if it is not equal, the weight is the answer.

As for 13 ball, I still haven't thought of it. Hope to enlighten me. Onefi@frontfree.net

Summary: (reproduced) balance weighing, there are two trays relatively light, plus the outside of the tray, that is, there are three results per weigh, which is LN3 / LN2 bit information. n Ball should know one of the different balls. If you know the different weights of the ball is light or heavy, then if you find it, it is one of the n results, that is, there is ln (n) / ln2 bit information, if you don't know Light weight, it is one of the results in 2N (one, light or heavy, so it is 2N), which is LN (2N) / LN2 bit information.

Suppose we want to say k times, according to the information theory, it is obvious that both: 1.K * ln3 / ln2> = ln (n) / ln2 (k> = 1) solution k> = ln (n) /LN32.K *LN3/LN32.KN (2N )/ln2 (k> 1) solution k> = ln (2n) / ln3 This is the lower limit, it can easily prove that the minimum positive integer of the condition is satisfied begging. For example, I have known 3 times knowing that it can find different balls from 3 ^ 3 = 27 balls. If you don't know, you can only find different balls from (3 ^ 3-1) / 2 = 13 balls. come out.

转载请注明原文地址:https://www.9cbs.com/read-98969.html

New Post(0)