Have fun with the algorithm interview together, nanny-level strategy (with high-definition uncoded algorithm summary map), recommended collection

This article has been included in Qijian's e-book "Change Your Fate Against the Heavens—Programmer's Road to God", github address: https://github.com/harvic/FightingCoder  Welcome to star. Click [Read the original text] to go directly.

I was also stupid when I was in college. For school recruitment, I read no less than five algorithm books, plus LeetCode, and studied for more than half a year.

There are a total of one or two thousand questions... Don't brush for fear of passing the exam... Forget to brush, forget to brush... The hair is almost falling out...

Now I have been working for nearly ten years, and have moved to several large factories. I have changed from an examinee to a question maker, and I realized that it is not necessary to work so hard.

Everything follows the 28 principle, as long as we grasp the 20%, we can get 80 points!

Everything is cost-effective!

Save time, talk to a girlfriend, isn't it delicious? ? ? ! ! !

Here I will tell you my experience in writing questions over the years. I hope you know which are the key points and how to learn data structures and algorithms.

Directly on the dry goods, I spent two days making a picture, covering the knowledge points that will be mentioned in data structure and algorithm books. It also gives the average time complexity of commonly used algorithms, and puts a star in front of the content that must be learned

There are nearly 20 kinds of data structures involved: arrays, linked lists, stacks, queues, hash tables, binary trees, heaps, jump lists, graphs, Trie trees; more than 40 common algorithm ideas: recursion, sorting, binary search, search , Hash algorithm, greedy algorithm, divide and conquer algorithm, backtracking algorithm, dynamic programming, string matching algorithm.

After mastering these basic data structures and algorithms, it will be very easy and fast to learn more complex data structures and algorithms.

Algorithm map and recommended learning materials

Long article warning, the following content covers the experience of learning algorithms for more than ten years, summed up for your reference.

The article has been written for a long time, I believe it will definitely help you, and I hope everyone can give me a like to show encouragement, thank you

Table of contents:

  1. Difference Between Data Structures and Algorithms

  2. How to learn data structure

  3. How to learn algorithms

  4. Algorithm is too difficult to understand? That's what you don't know about these mock sites

1. The difference between data structure and algorithm

Many students do not understand the difference between data structures and algorithms, and some students even think that algorithms are included in data structures.

In fact, you can get a rough idea from the literal meaning. The data structure mainly explains the organizational form of the data. In other words, I am how we want to store these data, so there are lists, heaps, stacks, trees, and graphs. This is data. The focus of the structure.

The algorithm focuses on ideas, such as how to sort the elements in the list, and how to find the largest and smallest numbers in the current storage structure? Wait, to put it bluntly, it is the idea of ​​​​solving problems in reality. That's why there are classic algorithms such as divide and conquer thinking, greedy thinking, and dynamic programming.

2. How to learn data structure

Regarding the data structure, what I want to say is that it is the simplest and most basic of the four. Without the data structure, almost any program will fail, so when discussing the data structure, it is often necessary to talk about the algorithm.

Simply mastering common data structures is as interesting and simple as dismantling delicate instruments. Just because the function of the data structure in the program is very similar to the instrument components, different data structures have different characteristics, so if you want to learn the data structure well, diagrams are a must-have weapon!

Here we strongly recommend the "Data Structure" course offered by Zhejiang University in Chinese universities, which covers commonly used data structures and algorithms.

https://www.icourse163.org/course/ZJU-93001

Supplemented by teaching materials and reference books, "Big Talk Data Structure" is strongly promoted. You can know the style of this book just by looking at the cover

That's right, this is the author of the famous "Big Talk Design Patterns", absolutely top.

3. How to learn algorithms

Algorithm courses are often put together with data structure courses. In some colleges and universities, there are two courses such as "data structure and algorithm" and "algorithm design and analysis".

The routine of learning algorithms is very simple, read more, write more, and use computers more. Since it is a collection of ideas, if you read a lot, you will naturally learn without a teacher.

As for brushing questions, many students know that they need to brush LeetCode.

LeetCode question bank: (2123 questions)

https://leetcode-cn.com/problemset/all/

There are more than 2,000 questions in total, and some questions are very difficult. Even if you have 10 questions a day, you have to study for at least half a year. This is obviously not suitable for most students.

Therefore, we need to find the core and most important set of questions, that is,

For example, if time is tight, you can first brush up the questions in the "Programmer Interview Collection", a total of 109 questions.

https://leetcode-cn.com/problem-list/xb9lfcwi/

After you finish brushing, sometimes, you can brush the questions of "Sword Pointer Offer", a total of 75 questions.

https://leetcode-cn.com/problem-list/xb9nqhhg/

Because these two books are a summary of high-frequency questions for interviews, naturally many topics overlap. This also shows the importance of these two books.

If you specialize in interviews, there are two good books to recommend:

The Douban score of the book "Programming Pearls" is very high, with 9 points.

The biggest feature of this book is that it talks about a lot of processing skills for massive data. This may be rarely covered in other algorithm books. During interviews, questions about massive data processing are often asked, especially in school recruitment interviews. Whether it is to broaden your horizons or deal with interviews, this book is worth reading.


 

The book "The Beauty of Programming" has many authors, most of whom are engineers from Microsoft, so the quality of the book is guaranteed. However, the algorithm topic here is a bit difficult and not very systematic, which is why I included it in the interview part. If you have a certain foundation and like to delve into some algorithmic problems, or you want to interview companies like Google and Facebook, you can take the questions in this book and test yourself first.

Of course, I also have a collection of high-frequency interview algorithm exercises summarized by Google brothers, which contains common data structures and algorithm summaries, both in layout and content, are very good.

I have prepared all these books and the opening mind map for you, and those who need them can get them directly on the spare account.

Algorithm map and recommended learning materials download
 

4. Is the algorithm too difficult to understand? That's why you didn't know there were these mock sites

The difficulty of the algorithm is that there is no way to abstract its steps in the mind.

For a boy who struggled to do a geometry problem, it was even more fatal.

Today, I will recommend several websites for algorithm visualization.

That's right, after writing the code, you can see how they get the result step by step.

1、https://visualgo.net/en

Currently the website supports Chinese, Indonesian, Japanese and other multi-language versions.

Most importantly, it contains almost all algorithms! ! ! !

In the search option, you can find the algorithm you want based on keywords.

After clicking on a specific algorithm, there will be two ways of visual presentation, one is the electronic lecture mode, and the other is the example mode. Among them, the example mode is presented in the form of animation, and you can control the fast forward and reverse of the animation. The e-lecture mode is presented in the mode of explaining knowledge points, and you can manually control the progress of the page. Both ways can help you demonstrate the procedural code of each step.

Next, we demonstrate the execution process of bubble sort, as shown in the following figure:

Alternatively, you can create a custom set of numbers and have the animation show "your algorithm".

In addition, online testing is also supported~

2、https://algorithm-visualizer.org/Algorithm

In Algorithm Visualizer, everyone can clearly see the whole process of algorithm operation, which is very intuitive and easy for everyone to learn.

You can clearly see that the website is divided into three parts. The leftmost is the algorithm directory. You can choose the algorithm you are interested in. At present, it has included many algorithms, such as binary tree, graph, sorting algorithm, dynamic programming and other classics. algorithm. The middle area is mainly for algorithm demonstration and running log. On the right is the code and the algorithm run button.

We use it to demonstrate the execution process of bubble sort, as shown in the following figure:

At the same time, it is open source. There are currently 35K stars, which is enough to show the popularity of the project. Here I recommend it to everyone who wants to learn algorithms.

https://github.com/algorithm-visualizer/algorithm-visualizer

3、https://www.cs.usfca.edu/~galles/visualization/Algorithms.html

At present, there are many visualizations of commonly used data structures and algorithms, such as: common arrays, linked lists, queues, binary search trees, red-black trees, various sorts, etc., as shown in the following figure:

For example, we use it to simulate a binary search tree, as shown in the following figure:

Let's use it again to demonstrate the quick sort algorithm, as shown in the following figure:

5. To improve computer skills, you have to rely on the Online Judge system

Now the school recruits are all online exams, and they will be required to directly write executable code.

Some students just don't have experience on the computer, and they don't even know how to submit. Not to mention how to make the program you design conform to various pre-set test cases. How long you can pass the test case is the key to how many points you can get.

Therefore, it is very necessary to use the computer system used for the exam to practice in advance and find out the feeling.

Now there are many open judging systems. Here are dozens of different types of OJ websites collected for you. If you have a chance, you can take a look.

1. A few that I strongly recommend

Peking University POJ    poj.org/

One of the most popular OJs in China, there are all kinds of difficult questions.

Hangzhou Dianzi University HDUOJ    http://acm.hdu.edu.cn/

One of the most popular OJs in China, with a large number of topics and a wide range of sources.

UVA     https://uva.onlinejudge.org/

One of the largest and oldest OJs in the world, with the largest number of questions. Browsing requires FQ.

codeVs http://codevs.com/

One of the largest Chinese OJs today, its ladder function allows players to practice various algorithms according to the difficulty level. codevs is also the first OJ I came into contact with. It has a rich question bank and moderate difficulty. You can check the answers to the current mistakes unconditionally. It is reported that the webmaster WPH95 wants to expand CODEVS to AI and other aspects in the future. The specifics are not known, but it is still unquestionable as a powerful line of OJ.

Luogu  http://www.luogu.org/

The up-and-coming rookie on OJ quickly occupied a large share of OJ evaluations. Its proving ground function is the same as CODEVS' ladder function, allowing players to improve by stages. Personally, I think the difficulty classification of the questions is not appropriate. Why is there such a big difference in the difficulty of the questions that are also "popularization + improvement-"? Support online IDE programming.

Its code disclosure plan allows people who submit this question and reach 60 points and join the code disclosure plan to view other people's code.

Big Vision Online Evaluation BZOJ   http://www.lydsy.com/JudgeOnline/

The difficulty of the questions is mostly at the provincial level and above, but some questions require purchasing permission to access.

UOJ    http://uoj.ac/

Hold UER with NOIP difficulty and UR with provincial difficulty. The quality of the competition questions is extremely high, and most of the testers are active training team players.

Clear orange evaluation tsinsen    http://www.tsinsen.com/

Training team homework website. The content of recent years has not been made public.

ACdream   http://acdream.info/

2. College type OJ

Hunan Normal University High School vijos  https://vijos.org/

Xuejun Middle School OJ  http://www.hzxjhs.com:83/

Henan Experimental Middle School OJ http://cojs.tk/cogs/index.php

Nanyang Polytechnic OJ http://acm.nyist.net/JudgeOnline/problemset.php

Peking University online evaluation http://openjudge.cn/

Seems like a place where many colleges start contests to submit assignments. As the NOI website announced in 2015 that the NOIP exam will draw questions from the NOI question bank group on this website, in detail this website will welcome many visits from OIERS.

Marcool of Bayi Middle School http://www.marcool.net/home/index.htm  ZOJ of Zhejiang University  http://acm.zju.edu.cn/onlinejudge/

Southwest University of Science and Technology SWUST OJ  http://acm.swust.edu.cn/

(Only for on-campus students to register)

Jianlan Middle School OJ https://school.jloj.cn/oj-plus/

Tianjin University OJ http://acm.tju.edu.cn/toj/

THIMUS OJ  http://acm.timus.ru/

Nankai University OJ http://acm.nankai.edu.cn/

Huazhong University of Science and Technology OJ http://acm.hust.edu.cn/

Qiqihar University OJ http://www.smartoj.com/

Zhejiang University of Technology OJ

http://acm.zjut.edu.cn/system/messageInfoAction.do?method=initIndexPage

Saratov State University OJ http://acm.sgu.ru/

Fuzhou University http://acm.fzu.edu.cn/

University of Electronic Science and Technology http://acm.uestc.edu.cn/#/

Shanghai Jiaotong University OJ http://acm.sjtu.edu.cn/OnlineJudge/

University of Science and Technology of China OJ http://acm.ustc.edu.cn/ustcoj/

Ningbo Institute of Engineering https://ac.2333.moe/

Beijing Normal University http://acm.bnu.edu.cn/v3/

3. Free OJ

九度OJ http://ac.jobdu.com/problemset.php

RQNOJ  http://www.rqnoj.cn/

RQNOJ is the forerunner of the development and operation of the domestic OJ (Informatics Online Assessment) open platform

tyvj  http://tyvj.cn/

Mainly for information science competitions, it was established in 2009, and now it seems to be in the hands of Qingbei Academy. (Speaking of which, we hung up the big rush when we went to Qingbei, Beijing, and it hasn't been taken down yet)

4. Competition OJ/community OJ/other foreign OJ

cf http://codeforces.com/

Codeforces is a Russian website that provides an online evaluation system for computer programming enthusiasts. The site was created and operated by a group of Saratov State University. tc  http://www.topcoder.com/tc

The topcoder community is supported by millions of coders, so you can learn about many challenging projects and earn yourself extra money based on this. You can participate in daily or weekly coding challenges, and the projects offered by this community are extremely challenging and difficult for beginners, but worth trying.

cc http://www.codechef.com/

CodeChef is a developer community created by Directi, providing a platform for developers to practice, compete and progress. The community hosts a large collection of coding contest questions, allowing access to the source code of previous coding challenges answered by others. The community also sets the difficulty level, and you can choose challenges according to your own conditions.

Bestcoder

http://bestcoder.acmcoder.com/

Croatian coci

http://hsin.hr/coci/

Poland MAIN

http://main.edu.pl/en

Polish SPOJ

http://www.spoj.com/

Japanese JOI

http://www.ioi-jp.org/index.html

LIGHTOJ  http://www.lightoj.com/login_main.php?url=index.php

AOJ  http://judge.u-aizu.ac.jp/onlinejudge/

5. Challenging OJ

Project Euler PE  https://projecteuler.net/  Project Euler may be the most popular programming challenge website in the world. It has hundreds of thousands of users in the early days of the project, which is enough to show how influential it is. Project Euler is dedicated to encouraging, challenging, and developing problem-solving skills and fun for those interested in the fascinating world of mathematics.

https://leetcode.com/

Leetcode is an online programming website in the United States. It mainly collects written test and interview questions from major IT companies. It is a rare and good helper for fresh graduates to find a job.

The advantage of this website is that it will tell you the test data and what your output and correct output are, which is convenient for everyone to debug and learn. Currently, only C++ and Java are supported.

https://www.hackerrank.com/

The HackerRank website is an emerging social platform for coding programmers based on coding puzzles and coding problems encountered in real life. HackerRank is backed by venture capital firm Y Combinator.

In this community, they provide a variety of coding puzzles, game viruses, and real-world coding problems and challenges, allowing hackers to communicate, discuss and accept challenges in this community. HackerRank, as the name suggests, also offers online leaderboards and other competitive elements.

6. Learning OJ

Mengma http://oj.mengma.com/

Jisuanke http://www.jisuanke.com/

The content seems to be a lot, but in fact, it just recommends a few books and a set of videos. The listed websites are only for learning.

After learning these contents, the algorithm should be said to be very solid, whether it is school recruitment or work, it is already very sufficient.

Well, that's all for this article, I hope everyone can learn algorithms as they wish.

I'm Qi Jian, don't let your future self hate your current self, let's work together.

Give me a thumbs up, thanks.

Guess you like

Origin blog.csdn.net/harvic880925/article/details/118312852