Talk about several common misunderstandings of interview algorithms

In the next article, we will start to sort out the interview algorithm system. Today, there is a question that needs to be discussed- how to treat the algorithm correctly and how to conquer the algorithm.

Table of contents

1. How to treat algorithms normally

2. Some misunderstandings about preparing for algorithm interviews

1. How to treat algorithms normally

In the group of the teacher's previous algorithm class, a classmate shared a shocking information. He said a girl went to an interview and wrote in the personal strengths section of her resume that she was infertile and didn't need maternity leave. Is this an advantage? I asked several female colleagues, and they actually agreed with this, or at least did not object. Many girls are also repeatedly asked questions about family and marriage and childbearing during interviews, and even fail the interview because of this, which shows how cruel the workplace is! But the question is, is infertility a bright spot? We are job seekers, but we are not livestock and we are not machines. Everyone has the right to pursue happiness. We are more motivated to work for our family and children. This girl must have a deep loss in her heart, but this loss will not turn into the motivation to work hard, it may only become a muddle through time.

Seriousness can only do things right, and hard work can do things well. If I were her boss, I would encourage her to take leave to see a doctor when she should see a doctor, and work hard when she comes back. A company that only pays attention to attendance and working hours is not a good company, especially an Internet company that focuses on mental work. 

This incident also tells us how difficult it is to create a bright spot, and how expensive it is to add one to your resume. Then again, what is the highlight? We know that social recruitment interviews will examine three explicit aspects: project, technology and algorithm. There are also two implicit aspects: education and the grade of the previous company. The explicit meaning is that the interview can be chatted and can directly reflect your objective level. The implicit condition is that both parties will not say anything, but it is tacitly understood by everyone, and you cannot change it. Therefore, rich project experience is a bright spot, a strong technical level is a bright spot, a strong algorithm ability is a bright spot, a good school with a high degree of education is a bright spot, and a good company is also a bright spot. The interview is the battlefield, and it depends on who can make it to the end by displaying all the highlights.

Whether you can succeed in the interview and how much salary you can get depends on how much you are worth, not how much you can work overtime. I often see complaints about being discriminated against in various groups. When participating in online communication, almost every time someone asks two hidden conditions. Usually, people often ask repeatedly: I want to go to a big factory. Is there a chance for a specialist? Is there an opportunity for outsourcing? Do small companies have a chance? etc. In fact, is there any difference between telling you yes and no? what can you do Can't do anything! I can tell you 100 reasons why there is no opportunity, and I can also tell you 100 examples where there are opportunities. At least five of my colleagues have ordinary education, but entered Weibo Meituan and other big companies. Will you take the college entrance examination again for a few years? Can you turn back time and hit big factories again? If not, what's the point of asking this question?

Educational discrimination is ubiquitous, but no company dares to say it directly. It is the same in all walks of life, and everyone knows it well. Everyone has a love of beauty, if you choose Jia Ling and Yang Mi as your wife, who would you choose? We all know that Jia Ling is very good, very humorous, good character, and good at making money, so I choose Yang Mi for one reason: Yang Mi is beautiful! If the interview situation of two job applicants is very similar, one is from Ali, and the other is from a small company that no one knows, who do you want more? This is human nature and we cannot change it. We could also be the one we hate if we switch places.

Relatively speaking, R&D positions pay more attention to real talents and real learning. Even if you have a high degree and a good school, you may not be able to do it. If the technology is not clear and the algorithm is not well written, then the degree is just a display, and the opportunity is still there. There are many such examples. On the other hand, when there is a shortage of people, many companies will lower their implicit requirements and give you a chance for an interview. Then it depends on your interview performance. The project level, technical depth and algorithm ability will be real. It's a pity that many people are limp during the interview process. They can't explain the technology clearly, can't write the algorithm, or even give up directly. How can the other party give you a chance?

We all know that algorithms are difficult, but to go to a big factory and get a high salary, this is a hurdle that must be passed.

It is a pity that many people disappeared after taking the oath.

Many people only realize that the algorithm is weak when they are about to interview, and then rush to ask what to do. What can others do? If there is a solution in 3 days, then the teacher's class will not be hundreds, but tens of thousands. I believe that more people are willing to come.

In the past, the Internet industry as a whole was in a state of lack of people, and there were many opportunities, but the situation has undergone many changes in recent years. Although the Internet is not "the front end is dead, the back end is cold", the demand has dropped significantly. In the case of oversupply, inward roll-up is inevitable, as well as technology roll-out, and algorithm roll-out, so the algorithm is no longer a "nice to add to the cake", but a hurdle that every programmer must pass.

"If you are poor, you will be good for yourself, and if you are rich, you will benefit the world." We either lie flat or temper ourselves into gold. I believe that you who join the school of fish still want to exercise yourself. How to interview, how to learn technology, including the algorithm we will talk about next, all have scientific methods that can be trained, as long as the relevant abilities are trained.

So if someone asks whether Qidian has a chance to go to a big factory in the future, we will directly ask him "how is the algorithm", and if he says no, then tell him that there is no chance. On the contrary, encourage him, actively pay attention, and sprint when you have the opportunity!

I usually feel that I am quite smart, but when it comes to algorithms, I feel that IQ is 0, what should I do?

I can tell you clearly that the interviewer also comes here by brushing the questions. Most of the interviews are based on common questions, and the common algorithm questions are limited, and the types of questions that are often tested are also fixed, so you just need to use me as a driver's license. Same, just concentrate on learning it for a period of time.

Learning these is not to pass all interviews 100%, but to be able to handle more than 80% of the questions. Our courses will never say that you must be able to solve all the algorithms, then you need a lot of time and energy, our goal is to let you figure out 80% of the problems in the least time, and the rest of the time to learn technology, It makes more sense to do projects. So what should you do if you encounter a weird interview? Don't be afraid, the big deal is to greet his ancestors and change to another company.

Therefore, the algorithm is regarded as a driver's license. There are only a dozen common topics and more than 300 common questions. It is enough to regard it as a necessary skill to master. On the contrary, I have been avoiding and don't want to work hard, but complain every day, and I have to be tossed every time I change jobs. Even if big factories recruit people, many people have no chance at all.

The algorithm of the interview is actually useless, especially not in the work

Many people want to learn algorithms and think it is very useful for work, so they have to learn it well, so they have to brush LeetCode well. I can tell you that the algorithm in LeetCode is useless. Have you ever written a linked list at work? Have you ever written a binary tree? Have you implemented backtracking yourself, have you written dynamic programming? I never have anyway. Because this kind of code is not easy to expand and maintain, if you write it at work, you will definitely be scolded, but it is the absolute focus in the algorithm.

What is the use of that algorithm? In fact, it is a game to practice thinking. To put it bluntly, it is used for interviews. Then again, why do interviews have to write algorithms on the spot? Because algorithms are the most effective way to test whether you are gold. This way is not perfect, but the best.

I used to be very repulsive, but when I was interviewing others as an interviewer, I realized why it had to be like this. From the very beginning, I tried to identify the level of this person. I would analyze which projects he did by himself, which ones he really understood, and which ones he memorized. But only by asking the other party to write an algorithm of medium difficulty and watching his performance in the whole process, I can rest assured that his basic skills are solid.

why? Because algorithms are the common language of all programmers. Although they are all doing java, everyone's industry and specific things are very different. It is difficult to accurately judge a person's level. Maybe he just wrote an if else in the end after he talked about the design with hype. People who do CPU instructions are unlikely to understand what the front-end lady said about vue. Interviewers who work on the Internet may not feel much about job applicants who are good at databases. Data structures and algorithms have become areas where both parties can communicate, and the results can be seen immediately. In any case, being able to write and run them is a real skill. For large factories and many good companies, algorithms have become a necessary part of interviews, and some interviewers can only feel relieved if they test you personally.

2. Some misunderstandings about preparing for algorithm interviews

For algorithms, there are many, many arguments, and some are diametrically opposed. Here are a few. We don't like preaching, but in the previous courses, when chatting with many friends, we found that there were one or several problems, which would affect the learning effect, so let's just list them together. There is no good or bad point of view, and I hope it will help you to further examine the algorithm.

1. Learn without thinking, think without learning

It is often said that it took 3 hours to write an algorithm, so it is not good to say that it is not good, it can only be said that the efficiency is too low, and it is okay to do it occasionally. Many algorithms and methods are fixed, and it takes time and effort to come up with it all by yourself. Even if you write it out, it may be very poor in structure or design, and it is easy to forget. For example, in the chapter "Bitmap", we will introduce many techniques, which are almost impossible to come up with during the interview by yourself. This is typical thinking without learning, and some people are at the other extreme. Some people say that they have done 200 questions, but they still feel very confused. I very much doubt that he didn't do it clearly at all, maybe he just ran through other people's answers. If you have done a certain amount of questions, you will definitely find that a lot of inspection points are repeated. Many questions are essentially the same thing, so the questions are fewer and fewer, and you can even come up with your own questions. How can you become more and more confused? ? So how to divide learning and thinking? I feel that half an hour is the limit for doing the questions. If you still can't think of how to do it after half an hour, you should find someone else's analysis to learn.

2. Looking up at the starry sky and sighing, lowering your head and complaining constantly

Many people worry about algorithms longer than they actually practice. I don't know if you have been worrying about how to learn English well when you were a student. You spend all your time talking about crazy English and New Oriental, but you didn't really learn English well until you graduated. Why? One reason is that I cry every day to learn English, but I have never done it, let alone persisted. The same goes for algorithms. There are also people who are about to have an interview, so they are in a hurry to find a buddha's feet to hug, and usually don't care at all. Some people will choose a question on a whim to check whether their algorithm works or not. In all likelihood, it will fail, because a question may involve hash, tree, and recursion. As a result, you don’t even know how to define tree nodes. I don't know, how can I solve it, and I must hit myself in the end. This is like not exercising for a long time, and suddenly asked to run 10,000 meters, who can run down?

3. Always want to reach the sky in one step, once and for all

Some people thought about starting from 0, so they found a thick data structure book to read. But most people don't feel much about this kind of book, let alone insist on reading it, so it doesn't take long. Some people swear to finish all LeetCode, completely solve the algorithm problem, and then start from the first question and work backwards. You must know that the first questions in LeetCode are generally more difficult, so they worked hard and didn’t finish a few questions. They have no confidence. I don’t want to use it anymore, and I even feel afraid, and finally the algorithm becomes an unbearable pain. Some people hope that the algorithm can reach the level of memorization, and they can come by raising their hands. This is impossible. Our focus is on understanding clearly. When you give you some time during the interview, you can think about it and write it out, rather than memorizing everything That counts.

Some people always feel that dynamic programming is called an algorithm, and backtracking is called learning an algorithm, and they don't pay attention to basic problems. In fact, I think that the difficult questions can be mastered, but the basic questions are still a problem?

It's like always thinking about getting Bai Fumei, and being indifferent to the girls around you, you are doomed to be lonely all your life. Most of the algorithms in the interview process are based on basic questions and variant questions, which are a bit difficult, but not too difficult. If you only focus on the difficult problems, you will often not understand the difficult problems, but you will not know the basic problems. Maybe this is called obsession.

4. Anxiety because of other people's outward bragging

For example, I like to read some poisonous articles on how to brush algorithms, and some will recommend a bunch of books, especially "Introduction to Algorithms". I think this kind of person should be damned, because although this book is called an introduction, it is much more difficult than ordinary algorithm books, and it is impossible to read it without sufficient mathematical skills. People with a low starting point will lose confidence quickly after reading it, so this kind of book is not suitable for most people at all. This kind of poisonous text undoubtedly makes people believe that algorithms are inherently difficult, let alone fun. Learning without fun is destined to be unsustainable. There are also people who are particularly sensitive to those who show off in the group. Some people who have interviewed with big factories will exaggerate the tension of the interview in order to improve themselves. For example, they must finish writing in 30 minutes, and they must finish writing in front of the interviewer. Interviews are conducted remotely. The officer stares at your desktop and asks you to write and so on.

In fact, if you write an algorithm in front of the interviewer, if you have no idea, some interviewers will remind you. If there is a problem with your thinking, he will also remind you that if there is no problem with the plan, you will be allowed to write it, which will undoubtedly reduce the difficulty of writing your algorithm. So the interviewer is staring at you, and you just act as a master guiding you, so why be so nervous. Those people exaggerating how nervous the interview is will bring great panic and anxiety to others, so I see this kind of person once and for all, and you are absolutely welcome!

5. I always feel that it is enough to accumulate more algorithms in the work in the future

In fact, the focus of the interview algorithm and the engineering algorithm are completely different, and there is very little connection between them. We will see a lot of such examples in subsequent chapters. For example, Hash is widely used in engineering because it is simple, easy to use and stable, but once many algorithms use Hash, there is no gold content. So in the interview algorithm, Hash is just a spare tire, as long as there are other ideas, it is generally not used. In engineering applications, what we pursue is ease of use and stability, while algorithms focus more on thinking ability rather than whether they can be used. Therefore, a certain amount of accumulation must be made for the interview algorithm, and it will only be an illusion to expect accumulation at work.

6. Too much work, usually very busy, no time to study

Don't say you don't have time, because it's just an excuse, not hard enough for yourself. We have introduced how ruthless people do this before. Let me give another example today. When I was in graduate school, there was a doctor in the laboratory who had the opportunity to go to Stanford University. At that time, he only had 3 months to prepare English, and he still had scientific research tasks in hand. At that time, he had not even passed CET-6. How could he meet the requirements within 3 months? So he signed up for New Oriental's training class, insisted on studying in class, and then got up at 5 o'clock every morning to practice English, and he persisted like this until the exam was over. Later, after returning to China, a company offered an annual salary of 150W, but they didn't like it.

Do you think it would be faster to have him script it? Would it be better to let him do the demand? Will overtime be longer? Then why are their salaries several times or even ten times ours? Because he has a high grade! At critical moments, he can withstand pressure and do things that ordinary people can't do. The salary level is not only determined by the length of working hours, but also by your grade and demonstrated ability, which makes people believe that you are worth the price. I have always emphasized that I can work overtime, but it seems that my technical level is not enough. Although most of them will not be used in work, the algorithm itself is a proof of thinking ability. If you don’t know how to do it, you won’t be given extra money. If you can do it, you dare to ask for a few thousand more. It’s as simple as that.

7. Try to solve the pain of algorithms by rote memorizing answers

Does the algorithm have a template? There are, and there are many. The more advanced the algorithm, the more templates it has, such as binary search, various deck methods, numbers, bit operations, double pointers, sliding windows, backtracking, dynamic programming, etc., all have their own templates, and Prefix trees, line segment trees, heaps, balanced trees, etc. are a set of rules in themselves. After understanding the rules, almost no questions are needed.

Since there is a template, can you memorize it? That's wrong, the template is consistent in thinking and problem-solving ideas, but the specific code is ever-changing, and it is impossible to remember. And if you change the conditions a little bit, you may modify a lot of code, so it doesn't make any sense to rely on the answer. What is more reliable is to thoroughly understand the idea of ​​​​algorithms, do each question one by one, summarize the skills and techniques, and finally classify the questions and summarize the problem-solving routines for this type of questions. This is the template. Almost every chapter we will follow It's all done this way.

8. Can I get a certificate, and then I don’t have to face the interview?

I once tried to find the misunderstanding of various algorithms. During a class live broadcast, a classmate's question made me instantly confused, "Is there any proof of the algorithm?" I asked him why he wanted to do research, and he said that it could prove that his algorithm had passed the test, and then he didn't have to write it during the interview.

 

 

Guess you like

Origin blog.csdn.net/m0_63722685/article/details/131452702