A. Logical Reasoning
1. If you ask a worker to work for you for seven days, the reward for the worker is a golden stripe. Gold bars are evenly divided into seven connected segments.
You must give them a piece of gold at the end of each day. How do you give it to you if you just break it twice?
?
2. Cut a box of cake into eight parts and divide it into eight parts, but there must be one in the box.
3. James had a bridge and it was dark when crossing the bridge, so there must be lights. It takes one second for James to bridge the bridge,
It takes three seconds for James's younger brother, six seconds for James's father, eight seconds for James's mother, and 12 seconds for James's grandfather. Each
This bridge can have a maximum of two people, and the speed of the bridge depends on the least slow, and the light will be 30 seconds after it is ignited
Extinguish. Q: How does the James family bridge the bridge?
4. A group of people wear a hat on their heads. There are only black and white hats, black at least
There is one. Everyone can see the colors of others' hats, but not their own. The host will show you
Watch the hats on others' heads and turn off the lights. If someone thinks they are wearing black hats
A slap in the face. Turn off the light for the first time and there is no sound. So turn on the lights again. Let's check again. When the lights are turned off, the crow is still there.
Que silent. It was not until the third time that the light was turned off that there was a slap in the face. Ask how many people are wearing black
What?
5. Estimate the quality of the CN Tower TV Tower.
6. There is a diamond in each elevator door from the first floor to the tenth floor. The diamond sizes are different. You take the elevator
From the first floor to the tenth floor, the elevator door on each floor will be opened once, and only one diamond will be available.
Big one?
7. the U2 choir will arrive at the concert venue within 17 minutes, and a bridge must be crossed on the way. Four people will be taken from the bridge.
And you have to help them reach the other end. The sky is dark, and they only have one flashlight. I
At the same time, you can have up to two people crossing the bridge, and when crossing the bridge, you must hold a flashlight, so someone has
Bring the flashlight to both ends of the bridge. A flashlight cannot be lost. Walking for four
The speed varies. If two people walk in the same way, the speed of the slow person prevails. Bono takes 1 minute to bridge and edge
2 minutes to bridge the bridge. Adam needs 5 minutes to bridge the bridge, and Larry needs 10 minutes to bridge the bridge. How do they spend 17 minutes
Crossing the bridge?
8. It takes an hour to burn an uneven rope. How can I use it to determine a half hour?
9. Why is the lid of the sewer circular?
10. How many gas stations (CARs) are there in the United States )?
11. There are 7 grams, 2 grams of weight each, one balance, how to use only these items three times to put 140 grams of salt
Divided into 50, 90 grams each?
12. A train leaves Los Angeles at a rate of 15 kilometers per hour and goes straight to New York.
The speed is 20 km from New York to Los Angeles. If there is a bird, the speed 30 kilometers away and
The two trains are currently starting. They depart from Los Angeles and return when they encounter another train.
Yes. There was a train on both sides of the road. How long did the bird fly?
13. You have two cans, 50 red balls, 50 blue balls, and a random jar.
How can I give a red bullet ball the greatest chance of selection when selecting a bullet ball and placing it in a jar? In your plan, get
What is the exact probability of a red ball?
14. Imagine that you are in front of the mirror. Could you tell me why the images in the mirror can be upside down, but not upside down?
Upper and lower?
15. You have four pills in your jar, each of which has a certain weight and the contaminated pills are not
Contaminated weight + 1. weigh only once. How can I determine which medicine can be contaminated?
16. If you have an infinite amount of water, a 3-boast bucket and a 5-boast bucket, how can you accurately name it?
4?
17. You have a bucket of jelly, including yellow, green, and Red. Close your eyes and select the same color.
To capture two of the same color. The number of captured items can be determined that you must have two results of the same color.
Frozen?
18. Insert the car key into the door. In which direction can the car lock be turned on?
19. If you want to remove any of the 50 states, which one do you want to remove? Why?
20. For a batch numbered 1 ~ 100 switch all the lights on and off to perform the following operations
If the value of 1 is reversed, the value of 2 is reversed, and the value of 3 is reversed.
Switch again.
The number of the light in the closing status.
21. Assume that a disc is rotated as it is on a player. This disk is black and white.
. Suppose you have a limited number of color sensors. To determine the direction of the disc rotation, you need
How many color sensors are placed? Where should they be placed?
22. Assume that the clock reaches 12 o'clock. Note that the hour and minute hands overlap. Hour and minute in a day
How many times does the needle overlap? Do you know the specific time when they overlap?
23. The two odd numbers separated by only one digit are called odd pairs, such as 17 and 19. Proving odd-number Pairs
The numbers between them are always divisible by 6 (assuming that both odd numbers are greater than 6 ). It is proved that there are not three odd numbers
.
24. A room has a door (the door is closed) and three electric lights. There are three switches outside the house, respectively
Three lights are connected. You can manipulate these switches at will, but once you open the door, you cannot change the switch.
Determine the light for each switch.
25. Suppose you have eight balls, one of which is slightly heavier, but the only way to find this ball is
The two balls are compared on the balance. How many times can I find the heavier ball?
26. Playing a word splitting game below will disrupt the order of all letters. You need to determine what this word is
. Assume that the word to be split is composed of five letters:
1. How many possible combinations are there?
2. What if we know which five letters it is?
3. Find a solution to this problem.
27. Four women are planning a bridge. They all stood on one side of the bridge and wanted them to be there within 17 minutes.
Department passes the bridge. It is evening. They only have one flashlight. Only two people can bridge the bridge simultaneously.
No matter who crosses the bridge, whether it is a person or two people, must carry a flashlight. The flashlight must be sent
And cannot be thrown. The speed of a woman crossing a bridge is different. The speed of two people must be slow.
.
First woman: It takes 1 minute to bridge the bridge;
Second woman: It takes 2 minutes to bridge the bridge;
Third woman: It takes 5 minutes to bridge the bridge;
Fourth woman: it takes 10 minutes to bridge the bridge.
For example, if the first woman and 4th Women bridge the bridge first, and when they are past, 10
Minutes. If 4th Women are asked to send their flashlights back, they will be used when she reaches the other end of the bridge.
After 20 minutes, the operation fails. How can these four women bridge the bridge within 17 minutes? What else
Method?
28. If you have two buckets, one with red paint and the other with blue paint. You
Pull a cup from the blue paint bucket, pour a cup into the red paint bucket, and then pull a cup from the red paint bucket into the blue paint bucket
. Which of the two buckets has a higher ratio of red and blue pigments? This is proved by arithmetic means.
B: Crazy computing
29. Two 1-2 known ~ The number between 30. A knows the sum of two numbers, and B knows the product of two numbers.
A asked B: "Do you know which two numbers are there? "B said:" I don't know ";
B asked a: "Do you know which two numbers are there? "Jia said:" I don't know ";
So, B said, "Then I know ";
Then Jia also said, "Then I know ";
What are the two numbers?
30, 4, 4, 10, 10, plus, subtraction, multiplication, division, how do I get out of 24 points?
31, 1000! How many digits are there? Why?
32. F (n) = 1 n> 8 n <12
F (n) = 2 n <2
F (n) = 3 n = 6
F (n) = 4 N = Other
Use the +-*/and sign (n) functions to combine the F (n) function.
Sign (n) = 0 n = 0
Sign (n) =-1 n <0
Sign (n) = 1 n> 0
33. compile oneProgramFor example, F (7) = 1 + 3 + 5 + 7 + 11 + 13 + 17 = 58
34 ,...
Draw four straight lines with only one pen to connect all the nine points
35. What are the types of layer-3 4 Binary Trees?
36. The 1--100000 series are arranged in a certain order. How can I correct a number? Best writing
Method. What about two numbers?
37. What is the difference between a chain table and an array?
38. Why do you choose this method to create a chain table?
39. Select a typeAlgorithmTo sort out a chain table. Why do you choose this method? Use now
O (n) time.
40. Talk about the advantages and disadvantages of various stock classification algorithms.
41. Use an algorithm to reverse the order of a chain table. Do it again without recursion.
.
42. Use an algorithm to insert a node into a circular chain table, but do not traverse the chain table.
43. Sort an array with an algorithm. Why do you choose this method?
44. Use an algorithm to match a common string.
45. Reverse a string to optimize the speed and space.
46. reversing the order of words in a sentence, for example, converting "My name is Chris" to "Chris calls me ",
The fastest speed and the least movement.
47. Find a substring to optimize the speed and space.
48. Compare two strings and use the O (n) time and constant space.
49. Suppose you have an array consisting of 1001 integers. These integers are arranged randomly, but you
We know that all integers are between 1 and 1000 (including 1000. Besides a number,
All other numbers appear only once. Suppose you can only process the array once and use an algorithm to find the weight.
The number that is returned. If you use a secondary storage method in the operation, you can find
Algorithm?
50. multiplication or addition is not required to increase by 8 times. Now we use the same method to increase the number by seven times.
C: Creative Application
51. The salesperson sold his laptop worth RMB 20 thousand to Mr. Li due to misoperations
How did Miss Wang's manager write a letter to Mr. Li trying to get the money back?
52. How to Apply computer technology to the elevator system of a 100-storey office building? How are you
Is this application optimized? What is the impact of traffic, floor, time, and other factors on work days?
53. How do you implement an operating system that can be stored in a file or copied from the Internet at any time?
Protection measures to prevent unauthorized replication?
54. How do you redesign the ATM?
55. Suppose we want to use a computer to operate a microwave oven, what kind of software will you develop to accomplish this?
Tasks?
56. How do you design a coffee machine for a car?
56. What content will you add to Microsoft's word system?
57. What kind of keyboard will you design for a user with only one hand?
58. What kind of alarm clock will you design for deaf people?
Reference answer:
1. day1 to 1 segment,
Day2 asked the worker to return segment 1 to segment 2,
Day3 to 1 segment,
In day4, return segment 1 and segment 4.
Day5 and so on ......
2. In the face of such a strange question, some candidates cannot be divided with their brains, while some candidates feel
This question is actually very simple. Take out 7 of the eight slices of cake and divide the remaining one into the cake box.
For 8th People.
3. This kind of intellectual questions is actually a test of the applicant's ability to solve problems under restrictions. Specific
For this question, many people often think that Xiao Ming should come and go with the light, which saves the most time,
However, they cannot find a solution. But in another way, we can decide who is holding the light based on the actual situation,
Just make some changes: Step 1: James bridges the bridge with his younger brother. It takes 4 seconds for James to return. Step 2,
James crossed the river with his father, and his younger brother returned, which took 9 seconds. Step 3: mother and grandfather crossed the river. James returned, which took a long time
13 seconds. Finally, James and his younger brother crossed the river. It took 4 seconds. It took 30 seconds in total. How thrilling!
4. If only one person is wearing a black hat, then he will see everyone wearing a white hat. when the light is turned off for the first time
he should slap his face, so more than one person should wear a black hat; if there are two black hats, the first time both of them only saw the black hats on the other's head, they did not dare to determine their own color, but switched off the light for the second time, the two should understand
if they wear white hats, the other party should have slapped the last time. Therefore, they also wore black hats.
, as a result, there will also be a slap in the face; but the fact is the third time, it means that there are more than two black hats in the audience.
according to this, it should have been turned off several times, with several black hats.
5. For example, how can you quickly estimate the height of the bracket and column, the ball radius, and the volume of each part?
. Recruitment Officer's statement: "For cntower, it is still different from general riddles or smart questions
. We refer to this type of question as 'quick estimation title' mainly to evaluate the ability of quick estimation, which is one of the essential capabilities for software development
. Of course, the question is just a means, not a purpose. It is certainly necessary to get a final result
, but more importantly, the process of obtaining the result from the examinee is a method test. "Mr Miller gave an example to illustrate a reasonable answer. He first drew a sketch of CN Tower on paper, then fast
estimate the height of the bracket and column, and the ball radius, calculate the volume of each part, and then run it with the density of each part.
, finally, a result is obtained by adding.
there are actually many questions about this type, such as: "estimate the quality of water in the Mississippi River. "" If you
are the governor of Tennessee, estimate how long it will take to manage pollution in the Compaq River. "
" estimate the quality of rain that a person traveling in light rain will experience within 5 minutes. "
Mr Miller went on to explain:" questions like this, including some reasoning questions, are all taken by people.
problemsolving (problem-solving ability ), you just need to remember the answer to the question. "
for the company's recruitment purposes, Mr Miller emphasizes four points, which are the general note of creative companies.
heavy employee quality, it is the qualities and capabilities that people who want to achieve their own career dreams in well-known enterprises must possess.
.
requirement 1: rawsmart (pure wisdom) is irrelevant to knowledge.
requirement 2: Long-termpotential (long-term learning ability ).
requirement 3: technicskills (skill ).
requirement 4: professional attitude ).
6. Her answer is: if you choose not to take the first five floors, observe the diamond size of each layer and check the size of each layer.
. Select the next five floors, and select the diamond with the largest diamond size near the first five floors. So far
I don't know the exact answer to this question. "Maybe there is no accurate answer. I just want to test your ideas ."
.
7. analysis: a student from Cornell wroteArticleHe met this question during the Microsoft interview.
, Can only be made within 19 minutes.
8. Both sides are burned together.
9. One answer: the answer from a professor of computer science at the Massachusetts Institute of Technology is
In the case of other materials, his area is the largest. Second, if it's square, rectangular, or elliptical, it's boring.
When you pick it up, you can directly throw it into the underground road! But the circular lid can avoid this situation.
)
10. When this is a bit confusing, you may have to ask how small the country is.
Start with a car. The interviewer may tell you this number, but it may also say, "I don't know. Please tell me.
Me. "Then, you say to yourself that the population in the United States is 0.275 billion. You can guess that if the average
(Including Singleton) is 2.5 people. Your computer will tell you that there are 0.11 billion families in total. You recall
I have heard about where every household has 1.8 cars, so there will be about 0.198 billion cars in the United States.
Car. Next, as long as you figure out how many gas stations are needed to serve 0.198 billion cars, you can solve the problem.
Yes. What is important is not the number of gas stations, but the method for drawing this number.
12. The answer is easily calculated:
Assume that the distance from Los Angeles to New York is S.
The distance between the bird flight is (S/(15 + 20) * 30.
13. No answer. Check whether you have the courage to stick to your opinion.
14. Because the human eyes are symmetric horizontally.
15. extract one from the first box, two from the second box, and three from the third box.
And so on.
16. Complicated:
A. Use a 3-tier bucket to fill the bucket and pour it into 5-tier bucket. (3-> 5)
Mark B1 (B1 for short) in a bucket of 5 kubernetes ).
B. Use 3 to fill the filled water with 5 blank 3 to pour 5 water into 3 until B1 marks B2 in 3
C. Use 5 to fill the filled water with 3 blank 5 5 to 5 until B2
D. Empty 3. Pour 5 water into 3 and mark it as B3.
E. Fill in 5 blank 3 5 water 3 until 3 water to B3
Now, 5 water is the standard 4-boast dehydration.
20. The prime number is off, and the rest is on.
29. When two duplicates are allowed
The answer is x = 1, y = 4; A knows and A = x + y = 5, B knows the product B = x * Y = 4
Two answers are not allowed if two numbers are repeated.
Answer 1: x = 1, y = 6; A knows and A = x + y = 7, B knows product B = x * Y = 6
Answer 2: x = 1, y = 8; A knows and A = x + y = 9, B knows product B = x * Y = 8
Solution:
Set these two numbers to X, Y.
A knows the sum of the two numbers a = x + y;
B knows the product B = x * y of the two numbers;
This question is divided into two situations:
Repeat allowed, with (1 <= x <= Y <= 30 );
Repeat is not allowed, with (1 <= x <Y <= 30 );
If the repeat is not allowed, that is, (1 <= x <Y <= 30 );
1) Question Setting condition: B does not know the answer
<=> B = x * y the solution is not unique.
=> B = x * Y is a non-prime number.
∵ X = y
∴ B = K * K (where K is N)
Conclusion (inference 1 ):
B = x * y non-prime number and B = K * K (where K is N)
That is: B, (6, 8, 10, 12, 14, 15, 18, 20 ...)
The verification process is omitted.
2) Question Setting condition: A does not know the answer
<=> A = x + y is not unique
=> A> = 5;
There are two situations:
A = 5, a = 6 X, Y has a dual solution
A> = x, y has three or more solutions
Suppose a = x + y = 5
There is a dual solution
X1 = 1, Y1 = 4;
X2 = 2, y2 = 3
Input formula B = x * Y:
B1 = x1 * Y1 = 1*4 = 4; (excluding inference 1)
B2 = x2 * y2 = 2*3 = 6;
Obtain the unique solution x = 2 and Y = 3, that is, Jia knows the answer.
It is in conflict with the question: "A does not know the answer,
Therefore, the assumption is not true. A = x + y = 5
Suppose a = x + y = 6
There is a dual solution.
X1 = 1, Y1 = 5;
X2 = 2, y2 = 4
Input formula B = x * Y:
B1 = x1 * Y1 = 1*5 = 5; (do not satisfy inference 1, remove)
B2 = x2 * y2 = 2*4 = 8;
Obtain the unique solution x = 2, y = 4.
That is, Jia knows the answer.
It is in conflict with the question: "A does not know the answer"
Therefore, the assumption is not true. A = x + y = 6
When a> = 7
There are at least two solutions for the solutions between x and y that satisfy inference 1.
B1 = x1 * Y1 = 2 * (A-2)
B2 = x2 * y2 = 3 * (A-3)
Condition
Conclusion (inference 2): A> = 7
3) Question Setting condition: "I know", said B"
=> B obtains the unique solution through the known condition B = x * Y and inference (1) (2 ).
That is:
A = x + y, A> = 7
B = x * y, B '(6, 8, 10, 12, 14, 15, 16, 18, 20 ...)
1 <= x <Y <= 30
X and Y have unique solutions.
When B = 6: There are two groups of solutions
X1 = 1, Y1 = 6
X2 = 2, y2 = 3 (optional X2 + y2 = 2 + 3 = 5 <7)
Obtain the unique solution x = 1, y = 6.
When B = 8: There are two groups of solutions
X1 = 1, Y1 = 8
X2 = 2, y2 = 4 (optional X2 + y2 = 2 + 4 = 6 <7)
Obtain the unique solution x = 1, y = 8.
When B> 8: it is easy to prove multiple solutions.
Conclusion:
When B = 6, there is a unique solution x = 1, y = 6. When B = 8, there is a unique solution x = 1, y = 8.
4) Question Setting condition: A said, "I know it too"
=> Jia can obtain the unique solution through the known condition A = x + y and inference (3 ).
To sum up, there are two groups of solutions for the original question:
X1 = 1, Y1 = 6
X2 = 1, y2 = 8
When X is <= Y, there are (1 <= x <= Y <= 30 );
Similarly, we can obtain the unique solution x = 1, y = 4.
31,
Solution: 1000
LG (1000 !) = Sum (lg (n ))
N = 1
We can use three broken lines to replace the curve.
10 (0 + 1)/2 + 90 (1 + 2)/2 + 900 (2 + 3)/2 = 2390
As an approximate result, it seems like 1500 ~ 3000
32. F (n) = 1 n> 8 n <12
F (n) = 2 n <2
F (n) = 3 n = 6
F (n) = 4 N = Other
Use the +-*/and sign (n) functions to combine the F (n) function.
Sign (n) = 0 n = 0
Sign (n) =-1 n <0
: Sign (n) = 1 n> 0
Solution: you only need to pay attention to [sign (n-m) * sign (m-n) + 1] Getting 1 AT n = m and getting 0 from other points.
34. Just draw the meters.
59. The answer is to say goodbye to your family.
From: http://www.blogjava.net/wenhan-uk/archive/2007/08/17/137703.html