preface

Hi everyone, I’m Bigsai, long time no see! Today, I will share some small methods for you to brush the buckle, which may not be very useful but can be referred to. I wish you a more efficient and stronger!

Recently in some group chat, private chat encountered a lot of a problem is: brush, we have also paid attention to the importance of algorithm brush on the impact of dachang, more and more people began to roll up!

But some people are so rolled up, rolled up their own meng.

Today, I will give partial beginners all kinds of problems to talk about personal brush buckle this aspect of the point of view.

Which questions to brush?

We brush force buckle, the goal is certainly in order to impact the big factory interview written test, a small part is to insist on brush questions to maintain the feeling to improve their algorithm programming ability, so you must grasp the key content first, what is the key content?

Sword refers to offer:

Offer leetcode-cn.com/problem-lis… Offer is a high priority, employment must brush. Both Niuke and Likou platforms can refer to the question of offer, but I personally recommend likou platform. The first time I referred to offer was on Niuke platform with everyone (although I don’t know if anyone will remember it for a while), but some time ago, I referred to offer on Likou. Some of the questions (very few) submitted their own code long ago to try and found wa. So the test data is relatively weak, the test data on the force button is relatively more, in most cases, you pass the code basically no logic holes.

In addition to the sword finger offer famous, I recommend you brush sword finger offer one reason is that the title of sword finger offer is really classic! A short span of more than 60 problem, covering common data structures such as linked lists, binary tree, graph, queue, stack, hash tables, and so on, common algorithm and classical question a binary package, dynamic programming, full permutation problem, sliding window, greedy, partition, sorting, computing, DFS and BFS, etc., to brush over these questions, is really can harvest and learn a lot!

On the other hand, it is really very frequent for pointed offer to appear in the written interview. The questions examined by the interviewer are generally classic questions. The interviewer does not create questions, but only selects questions, and the selected questions are basically the questions of force button and pointed offer.

Power button HOT100 | power button before 200

HOT100: leetcode-cn.com/problem-lis…

Top 200: leetcode-cn.com/problemset/…

Priority HOT100, HOT100 is the 100 quality questions selected from the question bank at a certain time (because the questions have been increasing), these questions are similar to sword finger offer, are some high-frequency questions, many questions are indeed difficult, for many people especially easy to get stuck. However, if you can finish HOT100, then you will be able to offer 200 more questions.

At present, there are two or three thousand problems of force button, and the number is still increasing, so it is almost impossible to finish the brush of force button. If you want to brush in order, you still recommend the first 200. The first 200 of force button and the first 200 of force button HOT100 overlap greatly, and the quality of the first 200 is very high (not that the quality of the back is not high, Just so big question bank brush to the back will appear a lot of same type, same routine topic), so it is recommended to brush force buckle before 200.

After finishing these parts, I can brush nearly 300 high-quality questions. I think it is enough for most Internet company interviews, and it is relatively easy for me to see some changes.

Brush questions in order?

The above list of questions to be brushed, now that you know which questions to brush, is there a more recommended sequence? Do I need a sorting brush?

I think it depends on people.

If you have a basic knowledge of data structure and algorithm, for example, you are good at data structure in the postgraduate entrance examination or at ordinary times, you understand the principle of common data structure and algorithm and can realize part of it, or you have some experience in brushing questions, then I recommend you to brush directly in sequence. Objectively speaking, there are some difficult questions on force buckle and sword finger offer, and some of them require advanced data structure, but most of them are smart thinking questions based on data structure or logic. If you have the basis of data structure and algorithm, you will be easier to get to the examination site. When you encounter a technique or data structure you don’t know, learn to add it to your brain bank.

If you are really small white, then you have to find a way to walk manually for yourself, then I recommend you can according to some topics to each beat. Because you are small white if the order brush this problem will not learn, brush in the next problem, and learn a completely strange new thing. Without a foundation, it is difficult to absorb too many unfamiliar new things in a short period of time. It is easy to forget, and you will be in the agony of how to learn. So you can think of it as a kind of stair, and you can go up one level at a time. For a data structure of the problem, starting from the list first to learn through singly linked lists, double linked list, circular linked list all kinds of insertion to delete, and then find the list in question bank related problem individually breached (also in the list can be subdivided list insertion, deletion, inversion, merger, search, sort, etc.), list after special binary tree big project, hash… In this way, you can learn some data structure or algorithm skills in the short term, and brush the problem to consolidate the absorption effect is better! In this case, don’t think it’s easy to just do the next one, because if you don’t type, you probably won’t know what’s wrong with you.

Three whys

Why do not see a problem train of thought?

This situation is most likely because see less, brush questions is also a slow process, see more brush more, to feel faster. Part of it may be due to the arrangement of their own brush line is not peaceful enough. I can’t think straight.

Easy questions are easy to understand and hard to implement, right?

In this case, there may be a lack of training in basic logic and a lack of understanding of the collection framework of the programming language. Some questions may involve the collection framework (Map, Set, List, Stack, Queen) various nested, simultaneous requires you to have a clear sense of hierarchy and logic.

You need to be familiar with a programming language, familiar with the common operation apis, collection frameworks, and functions of the programming language. These are tools for solving problems that can help us to be more efficient (not handwritten queues and hash tables at a time).

This problem is recommended to brush a few simple string processing problems, string processing problems involve a lot of set framework and logic control, if the time is enough to recommend PAT grade B brush some practice logic and programming language master.

Read a lot of questions why or won’t brush questions?

Read a lot of questions did not brush that with no brush difference is not too big, the impression is weak. From the perspective of learning, brushing problems is a little similar to the way we learn math. We learn mathematical formulas and examples, but we still need a lot of practice to really master them.

Only their own personal knock on each line of code, each line of code logic is what their own thinking rather than understanding the thinking of others. From 0 to 1 complete implementation of the entire program, which can line into a complete logic, and then may appear a variety of bugs debugging to find out the problem.

You can look at the solution of the problem, see yourself to be able to write it out completely, if you brush 1000+ problem, you see the solution of the problem is not brush no problem, look at the idea of being stuck. But if the brush 100 less than, that you understand or honestly in accordance with the logic of others closed volume repeat again. There are a lot of problems with not implementing it, and it’s not surprising that you can’t remember it.

To sum up, if the number of brushed questions is less than 100, you can simply brush more questions. If you brush two or three hundred questions, you still have to find other reasons.

Get the flow of a problem

Get a problem, the correct brush and learning method is what?

Determine the investigation site, determine the train of thought

When you read a question, the first thing you need to know after reading the question is what is the content of the question? Of course, if you follow the topic, then maybe this aspect is much easier. You can first determine the big types of questions, whether it’s graph theory, or binary trees, or strings, and the most common array given a bunch of data. I’m going to take this type of problem and go to this common algorithm research point. Let’s say you’re given an array of data that you can look up, and it could be a double pointer, it could be a hash, it could be a bit operation, it could be dynamic programming, it could be greedy. But most of the problems are variations on the classical problems of each classical algorithm, to know which classical problems the classical algorithm deals with.

If you can determine the research site, you can think about the details and start implementing it. If you are unsure of the topic, don’t look at the solution directly, look at the label. Sometimes you see a topic may say: this topic what method ah I will only violent search, some is indeed search pruning……

In addition to the label, also look at the data range! Data range of data are possible, different data range may use different methods (this array more questions, some questions skillfully with hash, in situ replacement of data requirements).

If you read the label and think about inspiration, it’s best. If you still don’t get inspiration, click on the solution. See if you can get inspiration from the label title, there are a lot of problems that give enough hints that some people will get it when they see it.

If still can’t that honest point go in to see other people’s ideas, have a plenty of video, have a plenty of pictures and texts, understand so far, if you still don’t understand, or ask for leave for others, or give up!

Write code, test

Write code without reference! Write code without reference! Important words two times, ideas can see, other people’s code can also see, you write code do not reference and CTRL C + CTRL V, engineering projects can run on the efficiency of the behavior are CV large method, but the interview pen test questions to you basically closed, some even you use online IDE even hints are not complete.

Common questions to consider when writing code: Test data boundaries (e.g. Integer.MAX_VALUE, integer.min_value), loop control boundary processing, end data processing (sometimes forgotten processing), special exception considerations, value range is reasonable, algorithm complexity can run, data depth copy, Simplify repeated traversal and operation, clear variable names, complete comments……

After writing the code, test it with test cases to make sure it’s safe. The null test case is often issued because this wa is used many times…

If there is a problem that is different from what you imagined, first look at your own code logic to see if you can see the problem. If you can’t see it, print it out or debug it to find the problem until it is correct. There are many problems that need to be considered.

Comparison of methods and results

Instead of thinking that the AC is over, you need to look at how many people you’ve surpassed in time. It’s recommended to measure your code in these two dimensions:

Exceed 70% or more (improve accordingly) : Exceeding 70% on most questions indicates that your method is ok, and there may be some small areas that can be improved. For example, StringBuilder concatenates strings instead of Strings, uses char[] arrays instead of strings for traversal enumeration, and so on.

Your method is within the time range of the good method: some problems are relatively large, and everyone is the fastest method. Your code may be 1ms worse than others, so it seems very slow. At this time, you just need to make sure that your method is very good, you don’t have to pursue 100%, and the time cost is different. You can look at people’s time consumption range, if your method is within a few ms of the fastest or 30% of the time range, in fact, it is OK. Others 4ms, you have no problem with 5ms, others 50ms, you have no problem with 70ms, but if others 80ms, you 800ms that difference is too much to see their own logic and code.

In addition, if you click on the bar chart of time in front of you, you can see other people’s code with less time overhead (some of them may run now because the test data changes not so fast). You can refer to learn how others deal with it.

Strengthen their

Passed this problem, can see problem solution distinction person has more clever processing method, have a direct contrast impression with others after your own AC can be more profound: still can be so!

If you feel that this type of question is not solid and want to practice again, you can see similar questions to consolidate in time.

conclusion

Some of the above methods are limited to some beginners advice, may not be very accurate and efficient reference, if the above questions almost have spare time, recommend you can follow a daily cenck, half a year is 180+ questions, 365 questions a year, quite objective!

The first original public bigsai, welcome attention, progress together!