Java programmers may be concerned about what technical skills a Java programmer with 3 years of experience should have. It’s important to note that not everything on this list is necessary, but the more knowledge you have, the higher your evaluation and salary will be.

1. Basic grammar

This includes the use of static, final, transient, foreach loops, and so on. If you answer static modifiers, modifiers I will think you qualified, if you answer static blocks, I will think you are good, if you answer static inner class I will think you are very good, and if you answer static guide package I will be very satisfied with you, because I can see that you are very keen on research technology.

In my most in-depth interview, I remember being asked directly about the underlying implementation of the Volatile key. (By the way, the interview and the intervieware themselves are relative, and the interviewer’s ability to ask this question also makes the interviewer feel that the interviewer is also a technical person, which makes the interviewer feel good about the company. I ultimately chose the company that asked this question), and don’t be too picky — simple questions tell you a lot about your skills, and breadth is often more important than depth, remember.



2, collections,

It’s very important and it’s a must-ask. List, Map, Set, etc.

ArrayList, LinkedList, Hashtable, HashMap, ConcurrentHashMap, HashSet, etc. ConcurrentHashMap is one of the most frequently asked questions in interviews, probably because it can generate so many questions. For ConcurrentHashMap, I would like to offer three answers or research directions:

(1) Lock segmentation technique of ConcurrentHashMap.

(2) Whether the read of ConcurrentHashMap should be locked and why.

(3) Whether the iterator of ConcurrentHashMap is strongly consistent or weakly consistent.

3, the framework

It’s a cliche. It’s an interview question. In general, I will ask you about the framework you are using in your project, and then I will give you some scenarios to ask you how to use the framework, such as how I want to do something when Spring initializes the bean, how I want to do something when the bean is destroyed, the difference between $and # in MyBatis, etc. All these are practical. Usually accumulated well, how much learning framework use details naturally are not a problem.

If you answered the above questions well, the interviewer will often ask in depth how the framework works. One of the most frequently asked questions is the implementation principle of Spring AOP. Of course, this is very easy to do in two sentences, even if you don’t have to prepare for it. The weirdest I encountered was when I was asked to draw a UML diagram of Spring’s actual Bean plant, an insightful question I was, of course, absolutely unable to answer

4. Database

Nine times out of ten, the database will ask. Some basic differences like and all, left JOIN, several indexes and their differences are not discussed, the more important is the database performance optimization, if the database performance optimization is ignorant, then have time, or suggest you spend a day or two before the interview specifically to prepare the SQL foundation and SQL optimization content.

However, the database is not to worry about, a company often has many departments, if you are not familiar with the database and the basic technology is very good, nine chengdu will ask you, it is estimated that you will be put into the database use is not very high requirements of the department exercise.

5. Some Web issues

Java is primarily web-oriented, so some questions about the Web are also mandatory.

The two most common questions I get are:

Discuss several ways to implement distributed Session.

The four commonly used answers are naturally very satisfying to the interviewer.

Another commonly asked question is: Talk about the difference and connection between Session and Cookie and how Session is implemented. In addition to these two questions, the content of web.xml is the key. Filters, servlets, and listeners are not only clear about how they are implemented, but at least how they are used. In addition, some details such as get/ POST differences, forward/ redirect differences, and HTTPS implementation principles may also be examined.



6. Data structure and algorithm analysis

Data structure and algorithm analysis, for a programmer, is better than never and definitely comes in handy in the workplace. Array, linked list is the basis, stack and queue in-depth but also not difficult, tree is very important, more important tree AVL tree, red black tree, can not understand their specific implementation, but to know what is a binary search tree, what is a balanced tree, AVL tree and red black tree difference. I remember an interview, a certain interviewer and I were talking about the index of the database, he asked me: do you know what kind of data structure the index uses?

I think I got the Hash table. Wrong. Do you know why trees are used? I replied that because Hash tables are likely to have a lot of conflicts, it can greatly increase the time complexity of searching for tens or even hundreds of millions of data faces. And the tree is more stable, basic guarantee up to 20 or 30 times can find the data you want, the other party said not completely right, finally we still communicate about this problem, I also understand why to use a tree, here do not say, friends think index why to use a tree to achieve it?

As for algorithmic analysis, forget it. I was asked in an interview what sort method collections.sort used. Of course in order to show my erudite, analysis of the algorithm also have a certain amount of research (⊙﹏⊙) B, I still stiff upper lip said a may be bubbling sort bar. The answer, of course, is no. For those interested, check out the source code for the collections.sort method, which uses a sort called TimSort, or enhanced merge sort.



7. Java VIRTUAL Machine

To my surprise, the Java virtual machine was supposed to be a big part of the story, and the probability of being asked was almost zero in each of these companies. After all, I spent a lot of time researching Java virtual machines last year. I read Zhou Zhiming’s “Deep Understanding of Java Virtual Machines: Advanced JVM Features and Best Practices” more than five times.

Without further ado, the Java Virtual Machine has not been covered, but I feel it is worth investigating, so I will briefly outline some of the most important aspects of the Java Virtual machine:

(1) Memory layout of the Java VM

(2)GC algorithm and several garbage collectors

(3) Class loading mechanism, that is, parent delegation model

(4)Java memory model

(5) happens-before rules

(6) Rules for using the volatile keyword

Maybe the interview is useless, but on the way to the big bull, can not.

8. Design patterns

I thought it was an important part of the content, but I was only asked once in the interview of Alibaba B2B Business Division, when I asked about the decorator mode.

Of course, we can not be so utilitarian, in order to learn the interview, design mode is still very important in the work, very useful, 23 kinds of design mode focus on the study of more than ten kinds of common can be, the interview about the design mode of the question and answer are mainly three directions:

(1) What design patterns are used in your project and how to use them?

(2) Know the strengths and weaknesses of common design patterns.

(3) Able to draw UML diagrams of common design patterns.

Take a look at our previous blog post, “Big Talk” Design Patterns.



9. Multi-threading

This is also a must ask a piece. Because of three years of work experience, I will basically not ask you how to achieve multi-threading, I will ask some in-depth questions, such as the difference and connection between Thread and Runnable, how to start a Thread many times, what state the Thread has. Of course, this is only the most basic. Unexpectedly, several interviews were asked the same question almost at the same time, in different ways.

It all boils down to this:

If Thread1, Thread2, ThreaD3, and Thread4 count the size of C, D, E, and F respectively, and all the threads are handed over to Thread5 for summary, how should this be implemented?

Do the smart Internet have an answer to this question? Not hard, there are already classes available under java.util.Concurrent.

In addition, thread pool is also a relatively common question, how many common thread pool? What are the differences and connections between these thread pools? How does thread pooling work? To be realistic, you will be given some scenarios to answer which thread pools are appropriate for this scenario.

Finally, although this interview does not ask many questions, but multi-threaded synchronization, locking is also important. The difference between synchronized and ReentrantLock, the common method and static method of synchronized lock, the principle and troubleshooting method of deadlock and so on.



JDK source code

To get a high salary, JDK source must be read. The above content may also be linked to specific scenarios, JDK source code is to see you usually love to study. During the interview, I was asked a lot of questions about the JDK source code. One of the most difficult questions asked me was how to implement the String hashCode() method. Fortunately, I usually read the String source code, so I gave a general answer.

JDK source code in fact, there is no good summary, purely personal, summary of the more important source code:

(1)List, Map, Set implementation class source code

(2)ReentrantLock, AQS source code

(3)AtomicInteger implementation principle, mainly can explain the CAS mechanism and AtomicInteger is how to use the CAS mechanism to achieve

(4) The implementation principle of thread pool

(5) Methods in the Object class and the role of each method

It was a pretty tall order, and I spent the last year researching the source code of the most important classes in the JDK. It took time and effort, and in retrospect, it was worth it — not just for the interview.

Finally, if you are interested and have time, I suggest you learn and study SOA and RPC, service-oriented systems, large-scale distributed architecture is a must, saving a life, cure-all, and successful every time.

11, advice,

Each stage should have the goal of each stage, whether in life, study or work, we need to set goals, so that things to have the direction to have power oh; And do things in a regular rhythm, not disorderly. If you don’t set goals, you’ll feel like you don’t know what to do each day. Don’t know what to do first, what to do next; People also feel lazy.

If you find the content of this article helpful, you can follow me. In addition, I recommend a learning group: 650385180, which will share some videos recorded by senior architects: Spring, MyBatis, Netty source code analysis, high concurrency, high performance, distributed, microservice architecture principles, JVM performance optimization has become an architect’s essential knowledge system. Free learning resources are also available, and the knowledge maps listed in this article were shared and organized by groups.





Conclusion:

According to lifetime Growth Dictionary entry 464: The Flowerpot Effect:


I have seen such a saying: the sign of a person’s aging is not that he becomes stable and taciturn, but that he refuses to try again, and refuses to allow himself to be in unfamiliar situations. When you stop learning, lock yourself in a cage of shiftlessness, you’ve taken a big step toward mediocrity.