The importance of data structures and algorithms to programmers

Article directory 

1. Data structure [proficient]

2. Algorithms [lots of exercises]

3. The importance of data structures and algorithms [Reality]

4. Dachang interview [difficult]

5. How to learn data structure and algorithm [Planning]

1. The amount of code

2. The Importance of Blogging

3. Think more, draw more pictures

4. Book recommendation

6. Summary 【Prospect】


  Hello everyone, I am Ji Ning. Data structure and algorithm, this name is believed to be very familiar to everyone. It can be said that the mastery of data structures and algorithms determines the upper limit of the programmer's level.

1. Data structure [proficient]

  Data structure is a way for computers to store and organize data, and refers to a collection of data elements that have one or more specific relationships with each other. In software development, various data management requirements may be required, and various data structures are required at this time. The most basic data structures are arrays, linked lists, stacks, queues, hash tables, etc.

  Data structure can be understood as: data + structure . Data is a symbol describing objective things, manipulated by a program, and stored on a computer. The structure includes the logical structure and storage structure of the data.

  The logical structure is divided into collection structure, linear structure, tree structure, and graph structure; the storage structure is divided into sequential storage structure, chain storage structure, index storage structure, and hash (hash) storage structure.

  In general, different types of data structures are to manage data in different formats in memory, and perform operations such as adding, deleting, checking, and modifying these data

2. Algorithms [lots of exercises]

  Algorithm : It is a well-defined calculation process that takes one or a set of values ​​as input and produces one or a set of values ​​as output. Simply put, an algorithm is a series of computational steps used to transform input data into output results .

  As we all know, data structures and algorithms are inseparable. For the data in the data structure, we may also have some other requirements to perform some processing on the data. For example, sorting and searching, and even some more efficient algorithms in sorting and searching to achieve certain purposes we expect.

Common algorithm summary:

  Sorting algorithms : Hill sorting, direct insertion sorting, exchange sorting, quick sorting, merge sorting, counting sorting, selection sorting, heap sorting Search
  algorithms : hashing, backtracking, recursion, pruning, red-black trees, interpolation
  Graph theory : the shortest Path, minimum spanning tree, network flow modeling
  Dynamic programming : knapsack problem, longest subsequence, counting problem
 Algorithmic thinking : dichotomy, greedy algorithm, divide and conquer

3. The importance of data structures and algorithms [Reality]

  In the process of job hunting, everyone who recruits from the school generally has to go through a process of 1 written test + 3 interviews. Only after passing the written test can they participate in the interview. In this screening form, the written test ability is particularly important.

  Some small and medium-sized factories generally have 20-30 multiple-choice questions + 2 programming questions in the written test, while in the written test of some large factories, most of them are based on or 3-4 programming questions + question-and-answer questions form. And without exception, the difficult problems in the written test are all online OJ programming. And most of the answers must be done using data structures and algorithms.  ​​​​​​In 2021, NetEase also began to switch to the method of writing four programming questions.

   Tencent also has 5 programming questions. These should be companies that everyone is familiar with.

  It can be seen that the company’s requirements for students’ coding ability are getting higher and higher. Dachang’s written tests are almost all algorithm questions and are difficult
, and algorithm questions are only included in small, medium and long written tests. The algorithm is not only tested in the written test, but also the interviewer will basically let the interviewer write the code on the spot. However, the algorithm ability cannot be improved quickly in the short term , and at least half a year of algorithm training is required. Otherwise, the written test will be very difficult during the actual school recruitment, so the algorithm should be prepared early. Fresh graduates can participate in the Blue Bridge Cup, ACM, Baidu Star , etc. In the algorithm competition, it doesn't matter whether you win an award or not. You must improve your programming level through the competition.

  Brothers who have read the online OJ rule introduction I posted before should know that programming questions are really hard to get points!

4. Dachang interview [difficult]

  The interview is not easy! If you pass the written test but fall in the interview, it will be too bad. The following lists some questions that the interviewer often asks when the seniors and sisters are interviewing the big factory, for your reference.

A senior CVTE interview:

1. How to calculate how many objects a class instantiates?
2. If there is another derived class that inherits this class, how to calculate the number of objects instantiated by each of these two classes?
3. Do you understand unions and structures?
4. How to test whether a machine is big endian or little endian?
5. Do you understand queues and stacks?
6. How to implement a queue with two stacks .
7. Have you ever used templates?
8. Write a template function that compares the size of two numbers.
9. Have you used containers?
10. Determine whether the two linked lists intersect.
11. The difference between Vector and array.
12. What is the most satisfying project you did in school? Briefly describe the project

An interview with a senior at Tencent:

1. Self-introduction
2. How to learn STL?
3. If a product gives you how to detect memory leaks?
4. Inter-process communication, how is shared memory implemented, what problems will arise, and how to solve them?
5. Why is TCP reliable? How is reliability guaranteed? Why the three-way handshake? Why is the three-way handshake reliable?
6. Http data subcontracting problem;
7. Vector related;
8. Hashmap related;
9. The principle of red-black tree, time complexity, etc.;
10. The difference between Memcpy and memmove;
11. The client sends data to the server and intends to send aaa, and then bbb, but aaabbb may happen, how to deal with it?
12. In the mail server of the game, players frequently create and delete emails every day. There are massive data and different sizes. What scenarios will there be, how to store them, and how do emails get to the memory?
13. Write an algorithm question by hand

A senior sister Baidu interview:

1. Handwriting five questions , three programming questions , one database, one linux
2. Two database questions
3. How well do you know the algorithm, insertion sort programming
4. Talk about IP, TCP, ARP
5. What is the kernel
6. The main functions of the IP layer
7. The bottom layer of map and set
8. The usage of bootstrap, html, the full name of html
9. What do you think is the difference between the framework and the library

10. Code optimization
11. Hash table
12. Shell script
13. Quick sort idea
14. What is recursion
15. What is divide and conquer and what is the difference from recursion 16.
How does the web platform work
17. Linux commands
18. Understanding What are the cutting-edge technologies, how about English, and what English literature do you know? 

  These interview questions are marked purple for the content of data structures and algorithms. From this we can see how important data structures and algorithms are to job hunting in the future.

5. How to learn data structure and algorithm [Planning]

1. The amount of code

  Compared with pure C and python, the data structure and algorithm have significantly improved the code length and code difficulty. If you just read and study without spending time writing code, you will suffer a lot in the school recruitment when facing a large group of paper kings. of. Therefore, thousands of words are not as practical as having time to do more algorithmic questions.

2. The Importance of Blogging

  I have a deep understanding of the importance of blogs for learning. A blog can be used as your own technical notes. When you write a blog, you will find out, wow, I still have so many things that I haven’t understood. In order to make the content of the blog correct, you will be forced to check the information and learn more. understanding of knowledge. Secondly, blogging can also promote continuous learning. Every time I finish writing a blog, I will have a great sense of accomplishment and fulfillment.

3. Think more, draw more pictures

  Faced with some incomprehensible operations and thoughts in the data structure, we often cannot look at the ceiling and think with our brains. When it is time to do it, we need to do more, draw more pictures, and think about problems in combination with pictures.

4. Book recommendation

Data structure and algorithm learning recommendation:

Teacher Luo Yongjun's "Algorithm Competition" , the algorithm idea is simple and clear, and the code implementation is not sloppy.

Cheng Jie's "Big Data Structure" , the story is more interesting, it can be used as an introductory book on data structure.

"Xiao Hui's Algorithmic Journey" by Wei Mengshu tells the basic knowledge of algorithms and data structures, complex and changeable algorithm interview questions and the actual application scenarios of algorithms through the virtual protagonist Xiao Hui's mental journey, in the form of comics

Recommended data structure brushing questions:

"Sword Pointer Offer" "Programmer Code Interview Guide" 

  The above two books can be read after learning the data structure and algorithm. After understanding 90% of the topics in "Sword Finger Offer", it can be said that you have reached the threshold of a big factory programmer. If you think again To improve, you have to brush up the real written test questions of Byte, Huawei, and Tencent or the algorithm questions on leetcode.

  Usually, it is recommended to use Niuke.com, Jisuanke, etc. for brushing questions. Without the foundation of a certain amount of code, it is not recommended to brush leetcod directly, the loss outweighs the gain.

6. Summary 【Prospect】

  Data structure and algorithm is a very important course, it is worth everyone's time to learn, but it is also difficult, which widens the gap between programmers. I hope everyone, and I also hope that I can study data structures and algorithms well, brush up the questions carefully, and have a clear conscience. Finally, I hope everyone can get their favorite offer and go to the love factory of their dreams in one or two years from now!

Guess you like

Origin blog.csdn.net/zyb___/article/details/131884367