At this time last year, I got the Offer from Alibaba after two months ‘review. I have some luck and some experience, which I would like to share with you with the arrival of job-hopping season. This article is not only review ideas, but also as learning ideas.

 

I roughly divided the Java review into the following directions.

JVM

JVM is a necessary skill for every developer. It is recommended to read the classic JVM books, which include the JVM memory interface, class loading mechanism and other basic knowledge. Do you feel that these are familiar in the interview? So instead of reading a bunch of random articles on the Web, take a look at Understanding the Java Virtual Machine: Advanced FEATURES and Best Practices for the JVM (2nd edition), while Oracle’s latest Java Virtual Machine specification is highly recommended if your English is good.

When you hit the books, remember not to try to be fast, you accumulate knowledge is not determined by the number of books, but by the depth of the books. So when you see each chapter, if you don’t understand it, you should cooperate with the online article to understand it, and you need to read several articles to understand it, because one article is likely to be wrong.

Sorting algorithms and Java collections, utility classes

This is a category that everyone must master and use skillfully, so why did I put them together?

Because both tools and collection classes are derived from algorithms, you need to understand why algorithms are required before you start your algorithms review — just because sorting algorithms are so relevant to our programming. Here are two chestnuts:

If you look at MergeSort and sort in Collections, you’ll see MergeSort is an implementation of MergeSort, and sort combines MergeSort and insert sort, This makes sort the worst O(NlogN) and best O(N). Then you can use the collection classes in Java better if you understand the implementation of sorting methods.

The second “kernel”, you’ve all heard of the TopN problem, often encountered in an interview please write down the implementation of TopN, when it comes to algorithms it’s a big top heap, when it comes to Java it’s an implementation of PriorityQueue, so you understand the TopN problem, you know its time complexity, its advantages and disadvantages, Is it possible to write more efficient programs using Java tool classes proficiently?

The reason sorting algorithms are as important as Java collections and utility classes is because they are so relevant to everyday programming. The interviewer is always asking about sorting algorithms not to embarrass you, but to test your programming skills. So you need to take a closer look at sorting and basic algorithms in conjunction with Java’s collection and utility classes to better understand their relationships.

Multithreading and concurrent packet sending

Multithreading and sending packets, the importance is not repeated, directly said about the learning method. The first thing you need to understand about multithreading is that there is more to it than threads and Runnable. The entire package below is for multithreading. For the study of multithreading must not look at a few interview articles, or a few keywords CountDownLatch, Lock Barabala thought to understand the essence of multithreading, the author here organized a big picture:

 

You need to look at the big picture, or make a big picture yourself, and break down each of the classes, including their usage scenarios, strengths and weaknesses. Of course, you need to see with the source code, source code is the big picture inside each source, and the above JVM, do not rush to finish reading immediately, but to understand why every place. As you get closer to it, you’ll see that it’s closely related to Java collection classes and utility classes, so it’s easy to see why it’s an important topic.

 

Redis, MySQL, ElasticSearch

Storage related tools Redis, MySQL, ElasticSearch. Knowledge points are divided into two parts, one is your experience using them and the other is your deep understanding of them. Redis Design & Implementation (Database Technology Series), High Performance MySQL, and The Definitive Guide to ElasticSearch are not necessarily the best books in the field, but if you know them well, For your understanding of knowledge and program design must be of great help. There is too much in the book, so I’ll give you two chestnuts.

First, you must not use Redis only as a key-value cache database. The author learned that one of its five basic types is called Sorted Set. In Sorted Set, both Hash and SkipList are used when the items content is greater than 64. This will also be optimized for sorting and lookup performance. SkipList changes are required for both additions and deletions, so the complexity is O(log(n)). But if you’re just looking up elements, you can just use Hash, which is O(1), and the other range operations are usually O(log(n)). Of course, if it’s less than 64, because of ziplist design, it’s O(n). So that in the future query and update reading become simple, that can be used to achieve TopN requirements? In this way, similar requirements do not require you to look up data, and then calculate and operate in memory. For example, we can use this data structure to realize simple weekly ranking and monthly ranking. Of course, this is not necessarily the best solution, but provides a way to solve the problem.

ElasticSearch Query (PriorityQueue) gets the PriorityQueue from each shard, and then merges the PriorityQueue. This “chestnut” tells us that algorithms are interlinked, and that if you understand one, you can draw a parallel.

The framework

Whenever we talk about frameworks, we think of Spring. When we talk about Spring, we think of IOC and AOP. Since everyone uses this framework, you don’t need to read anything else about frameworks, just dive into Spring. From the above description, you have already understood the ideas of xiaobian, which depends on its implementation principle. Therefore, I recommend you to read a book “Inside Spring Technology” and then comb the knowledge points from the flow of requests for your existing Spring project Debug. It has been so long since Spring came out that we have a clear understanding of the basic knowledge. What is important is to look at its ideas and principles to solve problems.

For example, do you need to use InitializingBean if you want to implement some operations when the Bean is just initialized? So how does it work, how does it work, and what is the life cycle of Spring beans? Through the specific use of the scene gradually expand the explanation, so that the review effect will be better, and then gradually think about each knowledge point involved in more knowledge points, such as AOP Proxy is based on what principle, what advantages and disadvantages.

distributed

This is an old topic, but also a hot topic in recent years, speaking of distributed must be related to Dubbo, but not only to understand Dubbo.

First we need to think about the problem it solves, why Dubbo was introduced. Along with the development of the business, the growth of the users, system, called dependencies also becomes complex, in order to make sure the system high availability, high concurrency requirements and architecture of the system is also from monomer time slowly migrated to service the SOA era, Dubbo arises at the historic moment, it as the emergence of RPC enables us to build micro services become simple, But we’re not just thinking about the frame support that Dubbo brings.

At the same time, it is necessary to consider the idemidemality of services, distributed transactions, Trace location between services, distributed log, data reconciliation, retry mechanism, etc. At the same time, it is necessary to consider the decoupling and burden sharing of MQ to the system, distributed database deployment and branch database table, flow limiting, fuse and other mechanisms. Therefore, the final conclusion is not only to look at the use and principle of Dubbo, but also to think about the upstream and downstream and some system design issues. There are many relative knowledge points, which can be broken separately for the points thrown out above.

Design patterns

There are many design patterns, but only a few are commonly used. This preparation can be divided into two aspects:

  1. Learn to apply, design patterns are not memorized, but used. Usually pay more attention to the design of the current project, whether the design mode can be applied, of course, must first understand the significance of the existence of each design mode;
  2. Think about the embodiment of design patterns in an existing framework. I’ve talked about how frameworks learn. Take Spring for example, there are more than 9 design patterns in it. If you don’t know, try to find them and think about why. Once you find them all, you will understand how the basic design patterns work and how they work.

Like can add attention, add like oh!