Interview question: a cow weighs 800 kilograms and a bridge bears 700 kilograms. How should the cow cross the bridge?

2021/08/1816:35:08 technology 759

Welcome everyone to pay attention to today’s headline number "JAVA Frontline" to see more wonderful shared articles, including source code analysis, practical applications, architectural thinking, workplace sharing, product thinking

1 problem analysis

on Zhihu Seeing this interesting question, first of all, this question is not to investigate the knowledge of architectural engineering, because not all interviewees have architectural engineering experience. I think this question is investigating three analysis methods: rationality analysis, structural analysis, and feasibility analysis.

Interview question: a cow weighs 800 kilograms and a bridge bears 700 kilograms. How should the cow cross the bridge? - DayDayNews


2 Rationality analysis

In the workplace, it is allowed to argue about the rationality of needs and problems, and rejecting an unreasonable demand is actually saving resources and costs. For example, product managers put forward business requirements, and programmers use code to implement business requirements. Before code development, everyone will conduct a requirement review, first assess the rationality of the requirement, and then evaluate the implementation details of the requirement. If after full discussion, everyone feels that this demand is unreasonable or unachievable, then this demand will be rejected.

Back to this question, an 800 kg cattle has to pass a 700 kg bridge. Is this demand reasonable? Then we can ask three questions from why, whether it is urgent, and whether it can be substituted:

The first question: Why do cows cross the bridge, what must cross the bridge, and whether it is necessary

The second question: If you have to cross the bridge, is the bridge need urgent? If it’s not urgent, it can be discussed in the long term.

The third question: Is there an alternative, whether you can take a boat or take a detourThen we no longer need to consider the bearing of the bridge.


3 Structured analysis

If the result of the discussion is that the cow has to cross the bridge, then we will think about how the cow crosses the bridge. Here we can use structured thinking to split the big problem For small dimensions, try not to omit or repeat. The factors that affect bridge crossing have these dimensions: the dimension of the bridge, the dimension of the cow, the dimension of resources, and the dimension of the environment.

Dimensions of the bridge: Reinforce the bridge to load more than 800 kg

Dimensions of the cattle: Waiting for the cattle to weigh less than 700 kg

Resource dimensions: Use a crane to transport the cattle over

Environmental dimension: cancel the gravity of the environment


4 Feasibility analysis

We have given a plan from the dimensions of the bridge, the dimensions of the cow, the dimensions of resources, and the dimensions of the environment, so which one to choose? ? This requires us to conduct a feasibility assessment, and choose the most suitable plan under resource constraints due to time and place.

The economic cost of strengthening the bridge is relatively high, and the time cost for waiting for the cattle to weigh less than 700 kg is relatively high, and the gravity technology of canceling the environment is difficult. The use of a crane to transport the cattle to the past seems to be the most appropriate solution.


5 Structured thinking extension

In these three analysis dimensions, we focus on analyzing structured thinking. The core idea of ​​structured thinking is not complicated: one thing can sum up a central idea, this central idea It can be supported by three to seven arguments, and each argument can be supported by three to seven arguments. The basic structure graph is as follows:

Interview question: a cow weighs 800 kilograms and a bridge bears 700 kilograms. How should the cow cross the bridge? - DayDayNews

It is not enough to analyze structured thinking.We should further analyze the internal structure of structured thinking, and the internal structure can be analyzed from the two dimensions of : vertical and horizontal: vertical structure embodies the two principles of conclusion first and unification of the above, and horizontal structure embodies classification Two principles of grouping and logical progression.


5.1 Longitudinal structure

5.1.1 Conclusion first

Conclusion first refers to the opening of the school to show the main idea clearly, so that the audience can understand the main idea of ​​the communication from the beginning, and if the main idea is hidden in the communication process, The audience may lose focus because they are distracted or communicate too much information, and they don't know what you are talking about. Conclusion There are six specific aspects in advance:

first important then second

first frame then detail

p1spanspan_span_span2 p1span_span_span2 Argument after the argument

first conclusion and then reason

first result then process

block quote If the system is not on-line, if the system is not quoted, it will lead to a failure of the system. Put it like this:

I saw that the database load increased,It may be caused by not adding an index. I found that I received repeated messages frequently. Is there something wrong with the message middleware? The monitoring also shows that a large number of threads are created. Is it caused by improper use of the thread pool ? It is difficult to find a conclusion in a short time for troubleshooting. Let’s roll back the code to the previous version first.

The important point is put at the end. I don’t know what he is going to do if I don’t hear it at the end, but what should I say if the conclusion comes first?

We should roll back the code immediately, because troubleshooting is more complicated, it is better to restore the system before troubleshooting. Possible problems are divided into three categories: the first may be database problems caused by improper use of indexes, the second may be middleware problems that cause a large number of repeated messages to be received, and the third may be that the thread pool is used improperly resulting in a large number of threads being created. After returning to normal, we will investigate these problems in turn.

It is not difficult to compare the two paragraphs of to find that the second paragraph has a much clearer structure and significantly improved information transmission efficiency. This is the advantage of the first conclusion.


5.1.2 The above system

The above system means that the thought of any one layer must be a summary of the thought of the next layer. Let's analyze an example to illustrate: Xiao Wang needs to buy beef and eggs today , Radish, juice, cabbage, milk, greens, chicken, yogurt, but he can't remember so many dishes, please find a way to help Xiao Wang.

The first step is to aggregate and summarize the dishes from the bottom up. This is a process of finding a pattern. The second step is to structure the expression under the above system to help memory.

Interview question: a cow weighs 800 kilograms and a bridge bears 700 kilograms. How should the cow cross the bridge? - DayDayNews

Bottom-up aggregation is not difficult to find,Beef, chicken, and eggs belong to the category of meat and eggs; cabbage, greens, and radishes belong to the category of vegetables; milk, juice, and yogurt belong to the category of beverages. After such aggregation, we will carry out structural expressions under the umbrella.

The above example is relatively simple, because the correlation between elements is easier to find, but the real scene is not so simple, the correlation between elements is not easy to establish, then how should we expand from the central idea to the second layer ?

Pyramid principle recommends the use of question-answer dialogue, which expands the structure downwards by asking questions. So which questions should be asked to cover the main points of the central idea? We can refer to the 5W2H analysis method and try our best to ensure that the main points are not missing:

What: What and what

Why: Why and why where pspan _pspan1 , Where to start

When: start and end time, milestones

Who: who is responsible, who will do it, who will accept it p1span _Howp2p , Where to cut in

How Much: how much to do, what are the indicators

Based on this model, we can simplify and reduce the number of elements.This is more conducive to structured expression and memory. We generally select the three core elements of What, Why, and How to form a 2W1H model.

Interview question: a cow weighs 800 kilograms and a bridge bears 700 kilograms. How should the cow cross the bridge? - DayDayNews


5.2 Lateral structure

5.2.1 Classification grouping

(1) Inductive reasoning

We generally use inductive reasoning and deductive reasoning. Let's look at inductive reasoning first.

Inductive reasoning refers to summarizing the observed facts and laws into theories. This method of reasoning is not rigorous, because as long as the observed facts and information are limited, the conclusions drawn by inductive reasoning are not necessarily correct. This is a common type of logic error: wrong attribution.

The swans that Europeans see are all white, so they conclude that all swans are white. When a black swan appeared, this conclusion was proved to be wrong. This is the black swan incident.

Of course, it is impossible for us to observe all the facts and collect all the information, but generally to solve a specific problem, we will collect information that focuses on a certain angle, and build a specific model to analyze and solve the problem. This is also a kind of Useful ways.

Pyramid principle inductive reasoning generally has the following four dimensions: time dimension, structure dimension, degree dimension, and experience dimension. The time dimension is summarized according to the natural timeline, the structural dimension is summarized according to the organizational structure, the degree dimension is summarized according to the degree level, and the experience dimension is summarized according to the existing experience. Let’s look at several common types of the above four dimensions respectively:

(1) Time dimension

Before, during, after the event

Short-term, medium-term, long-term

(2) Structural dimension

information Department, Administration Department, Ministry of Manpower

Development Group, Test Group, Operation and Maintenance Group

(3) Degree Dimension

Advanced, Intermediate, Elementary

Important, secondary, unnecessary

(4) Experience dimension

market strategy 3C theory

market decision 4P theory

High scalability, high availability, high performance

We select the time dimension and structure dimension to analyze an example: how to reduce code online failures.Analysis from the time dimension: code testing needs to be done beforehand, key indicators need to be monitored during the event, and analysis and review after the event is required.

Interview question: a cow weighs 800 kilograms and a bridge bears 700 kilograms. How should the cow cross the bridge? - DayDayNews

Analysis from the structural dimension: developers need to complete unit testing, testers need to do boundary testing, and operation and maintenance personnel need to improve the monitoring platform.

Interview question: a cow weighs 800 kilograms and a bridge bears 700 kilograms. How should the cow cross the bridge? - DayDayNews

(2) Deductive reasoning

Deductive reasoning refers to making inferences or judgments based on axioms, theorems, or concepts you believe in, and reaching conclusions.

This method is logically rigorous. Proposition A is true, and it is inferred that Proposition B is also true. That is because the truth of Proposition B is contained in Proposition A.

needs to be logically rigorous, not that the conclusion must be correct. For example, the idea that oneself believes is proved to be wrong in the end, then the conclusion is also wrong.

This is a top-down reasoning method, inferring downward from known axioms, theorems, or concepts. To use this method, you need to have some experience and accumulation in the problematic field.

Standard deductive reasoning is divided into major premises, minor premises and conclusions: all birds can fly. This is a bird, so it can fly.

deductive reasoning can also is divided into three elements: phenomenon, cause and solution: the phenomenon is that the quality of the developed code is not high, the reason is that there is no unified code protocol, and the solution is to formulate a unified code protocol.

Interview question: a cow weighs 800 kilograms and a bridge bears 700 kilograms. How should the cow cross the bridge? - DayDayNews


5.2.2 Logical progression

Logical progression means that each kind of thought needs to be arranged in a certain order. The time dimension is arranged before, during and after the event, and the degree level is according to advanced , Intermediate, and Elementary. For example, in the time dimension, we can continue to use how to reduce code online failure cases,According to the before, during and after the timeline, this order is more in line with the understanding and memory habits of .

Interview question: a cow weighs 800 kilograms and a bridge bears 700 kilograms. How should the cow cross the bridge? - DayDayNews


6 Article summary

For more structured thinking content, please refer to my article: How does pyramid thinking guide technology system optimization? Conclusion is not the most important answer to this type of question Yes, because it is essentially investigating thinking methods, so the thinking process is the most important.

Welcome everyone to pay attention to today's headline number "JAVA Frontline" to view more exciting shared articles, including source code analysis, practical applications, architectural thinking, workplace sharing, product thinking

.

technology Category Latest News