ByteCode, dedicated to share the latest technology original articles, involving Kotlin, Jetpack, translation, system source code, LeetCode/point Offer/multithreading/domestic and foreign large factory algorithm problems and so on a series of articles.

LeetCode unconsciously brushed 210 questions and submitted 1,069 times in total. I want to write an article to talk about my feelings and experience of brushed questions with LeetCode, mainly including the following contents.

  • LeetCode brush process?
  • Why did you brush?
  • Can you really find a job?
  • How to brush questions?

In addition to scanning LeetCode, I can also do the Daily Coding Problem above. Daily Coding Problem includes algorithm problems of many foreign companies (Google, FaceBook, Uber, Amazon, etc.). I also sorted out some questions and solutions in the process of swiping questions. For convenience, I sorted out these questions with the docsify tool. It contains LeetCode/sword Offer/multithreading/domestic and foreign big factory algorithm questions. I will rewrite these contents in the way of graphic algorithm in the later stage.

  • Job interview with major companies at home and abroad
  • LeetCode: Read online

Brush the topic course

Data structure and algorithm are now one of the basic skills that every programmer must master, and also one of the threshold for interview. No matter in foreign companies or domestic enterprises, algorithm has become a must-ask question. I believe that there are many friends like me who just started to brush LeetCode to prepare for the interview.

The first time I swiped LeetCode was 3 years ago. As shown below, this is my first submission record

At that time, I used the international version mainly for two purposes, one is to learn English, and the other is to prepare for the interview, so I started to brush the questions intermittently.

In 2020, I switched from the international version to the domestic version, because the domestic version is getting better and better, and the question bank is more perfect. In addition to the basic algorithm, database, Shell, multithreading, there are also a series of questions such as programmer interview guide, sword point offer and so on. There is also an option of “questions in Chinese” or “questions in English”, which fully meets my personal need to learn English during the process of copying questions. The figure below is my annual report for LeetCode 2020.

Google has been strongly recommending Kotlin for several years. Since USING Kotlin, I love it and work efficiency has improved a lot. Therefore, I use Java and Kotlin respectively when I brush LeetCode, and NOW I am also picking up C language.

2020 is a year of rapid progress for me, and it is also the year in which I have brushed the most questions. The following is the submission record of my 2020 LeetCode annual report.

LeetCode’s annual report function is really great, and it was submitted 700 times unconsciously in 2020. In this year, 1 ~ 3 questions were brushed every week, and the previous questions were brushed again every once in a while. I am slow in solving problems, and I focus on mastering every knowledge point. In LeetCode, I can brush 400+ and 700+ questions quickly in most of the year. Maybe they have strong basic algorithm ability, so I can brush the questions quickly.

Why did you brush?

Like many of my friends, I started to brush LeetCode to prepare for the interview. Once I went out for an interview, I didn’t prepare any algorithm, because I participated in some algorithm contests in university and had some basic knowledge of algorithm. Therefore, I thought algorithm would not be difficult for Android development, but I failed that time.

After that experience, I began to brush the questions, which stopped after I passed the interview. Occasionally, I would brush the questions, which made me continue to brush the questions. I realized the importance of algorithm, because once when I was doing a function optimization, I suddenly found that I could use an algorithm that I had brushed before to improve its running speed.

From that time I was aware of the importance of the algorithm, we usually in the development of a function of time, because time is short, have no spare time to think, a lot of places are profiteering method, first realized the function first, when begin to do performance tuning, this part of the function, can use the efficient data structures and algorithms to solve, so as to improve its running speed.

So since 2020 continued to brush, not as a brush for the interview questions, but to realize the importance of it, brush the topic while combing knowledge points, and then repeated brush before done, when you brush in question official think of solution and the optimal solution in the same time, the in the mind have a clear sense of achievement, Gradually, I fell in love with answering questions unconsciously. Up to now, I have answered 210 questions and submitted 1,069 times in total.

Can you really find a job

If foreign companies they pay attention to the points on the algorithm, so the algorithm can well improve their passing rate, but for the domestic enterprises, the algorithm is not necessarily can pass, in addition to examining algorithm ability, and the basis of professional knowledge, system source code, source code, data structure of the open source library project design, network knowledge, done related knowledge, and so on. Most of the algorithm difficulty is in Medium, I also encountered a few Hard. In a word, domestic enterprises recruit, to recruit all talents, all aspects of the meeting and even know its principle.

Share the algorithm problems I have encountered in my impression:

  • The longest substring without repeating characters
  • The most points on a line
  • Flip linked lists in groups of K
  • Longest string of subroutines
  • The largest rectangle in a bar chart
  • The KTH largest element in the array
  • Multithreading: the realization of odd and even order printing
  • Replication of complex linked lists
  • Adjust the array order so that the odd number precedes the even number, keeping the relative order the same
  • Prints the subscript of a repeated number from a sorted array containing repeated numbers
  • A straight in playing cards
  • The last remaining number in the circle
  • A path that neutralizes a binary tree
  • Inverts the list node from position left to position right
  • Delete the penultimate node of the linked list
  • The number of substrings containing only 1
  • The longest path in a binary tree
  • Realize producer in and consumer
  • Minimum number of moves to make array elements equal
  • Find two numbers in the array that appear once, and the others that appear twice
  • .

How to brush the topic

I also encountered this problem when I first started to brush the questions, the LeetCode question base is very large, how to start to brush the questions, when I was confused, I saw the experience of GOD K and set sail, I guess 95% of the guys who have brushed the questions should have seen the solution of God K, here I thank God K for his efforts.

Just because of the article shared by God K, I started to brush the series of “Sword Finger Offer” topics. Now I have used Java language to brush all the series of “Sword finger Offer” topics. Now I am going to use other languages to brush again, and at the same time, I will sort out the topics and solutions, and I will continue to share them later. The screenshot of “Finger Offer” is shown below.

If you are familiar with arrays, strings, stacks, queues, linked lists, trees, depth first traversal, breadth first traversal, search algorithms and so on, you can directly brush the “sword finger Offer” series of topics.

But if you are not familiar with the algorithms above, it is recommended to start with LeeeCode Home page -> Navigation Bar: Learn -> Filter Common data Structures, as shown below.

There are many data structure e-books on LeetCode, from which you can find what you want to learn and start to learn bit by bit. Over a long period of time, it does not depend on how many questions you brush, but whether you master every knowledge point. Precisely these basic knowledge points, in the actual project, the source code is very common, strongly suggest must master.

Once you have a good understanding of arrays, strings, stacks, queues, linked lists, trees, depth-first traversal, breadth-first traversal, search algorithms, and so on, you can start to brush up on the “Finger Offer” series.

If you are finished with “Finger Offer”, you can start to do “design” related questions. You can find the “design” tag in the “tag category” to view all “design” related questions.

In the design of this label, the actual problem scenario is sorted out. We need to use the data structure we have learned to assemble a new data structure suitable for the current problem scenario. Examples are LRU caching mechanisms, designing linked lists (single linked lists, bidirectional linked lists), designing circular queues, and so on.

Once you’ve mastered the basic algorithms, don’t just brush one type of problem, brush different types of problem, for example, do a few “design” related problems, and then switch to “multithreading” related problems or other types of problems. Below is a screenshot of my “multithreading” related topics.

conclusion

Now LeetCode platform resources are becoming more and more perfect, including design pattern, algorithm, data structure, multi-threading, programming and many other resources, has become a website I must log in every day, but The LeetCode question bank is very large, each category can screen many questions. I combined with a net friend, to share and his brush in the process of summary, according to the algorithm and data structure of the type classification, as shown in the figure below, can be classified according to my friends, the early stage of the listed her plan according to each knowledge point to brush, in the process, constantly summarize and review to find a suitable way.

  • Job interview with major companies at home and abroad
  • LeetCode: Read online

LeetCode not only helped a lot of people get offers from big factories, but also learned a lot of ideas from great minds at home and abroad. Besides, we could discuss with many students, and there were many interesting comments, which made the process of writing questions not so boring. LeetCode witnessed the pace of our growth. When you’ve been through a lot of boring, boring nights, you’ll get the results you want. I hope this article can bring some help to my friends.


This is the end of the article, if it is helpful to give me a thumbs up is the biggest encouragement

More code, more articles

Welcome to the public account: ByteCode, continue to share the latest technology



Finally, I recommend the projects and websites I have been updating and maintaining:

  • New video series: Modern Android Development (MAD) Tips series: View online

  • Androidx-jetpack-practice androidX-Jetpack-practice androidX-Jetpack-Practice androidX-Jetpack-Practice AndroidX-Jetpack-Practice

  • LeetCode/multiple thread solution, language Java and Kotlin, including a variety of solutions, problem solving ideas, time complexity, spatial complexity analysis

    • Job interview with major companies at home and abroad
    • LeetCode: Read online
  • Android10 Source code Analysis series of articles, understand the system Source code, not only help to analyze the problem, in the interview process, is also very helpful to us, the warehouse continues to update, welcome to check android10-source-Analysis

  • Collate and translate a series of selected foreign Technical articles, each Article will have a translator’s thinking part, a more in-depth interpretation of the original text, the warehouse continues to update, welcome to visit the Technical-Article-Translation

  • “Designed for Internet people, navigation of domestic and foreign famous stations” includes news, sports, life, entertainment, design, product, operation, front-end development, Android development and so on. Welcome to check the navigation website designed for Internet people

Article history

  • Android 12 behavior changes that affect applications
  • AndroidStudio
  • Kotlin’s Technique and Principle Analysis that few people know (1)
  • Kotlin’s Technique and Principle Analysis that few people know (II)
  • AndroidX App Startup practice and principle analysis of Jetpack’s latest member
  • Jetpack member Paging3 retrieves network page data and updates it to the database
  • New member of Jetpack Hilt and Dagger are very different
  • All aspects of Hilt and Koin performance were analyzed
  • PokemonGo Jetpack + MVVM minimalism
  • What is Kotlin Sealed? Why does Google use them all
  • Kotlin StateFlow search features practice DB + NetWork
  • [Google] Bye SharedPreferences embrace Jetpack DataStore
  • The end of the Kotlin plugin and the rise of ViewBinding
  • Surprisingly simple, DataBinding and ViewBinding