The skills that a Java programmer with 3 years of working experience should have are probably what Java programmers care about. It should be noted that not everything on this list is necessary — but the more knowledge you have, the higher your ratings and salary will be. 1. Basic syntax: static, final, transient, foreach loop, etc. 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. Collection is very important and must be asked. 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.

Frame a platitude, something you must ask in an interview. 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 most abnormal thing I encountered was asking me to draw a UML diagram of Spring’s Bean factory. Of course, I couldn’t answer such a profound question

4, the database database will also be asked nine times out of ten. 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.

Java is mainly oriented towards the Web, so some questions about the Web are also required.

The two most common questions I get are:

Discuss several ways to implement distributed Session. (You can talk about what you know.)

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.

Data structure and algorithmic analysis Data structure and algorithmic analysis are better than none for a programmer and can come in handy at work. 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 Machines to my surprise, Java virtual machines should be an important part of the content, but the probability of being asked by these companies is almost zero. Last year, I spent a lot of time studying Java virtual machine. I read Zhou Zhiming’s “Deep Understanding of Java Virtual Machine: Advanced JVM Features and Better 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) The Memory layout of the Java virtual machine (2) the GC algorithm and several garbage collectors (3) the classloading mechanism known as the parent delegation model (4) the Java memory model (5) the happens-before rule (6) the volatile keyword usage rule

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

8. Design mode was thought to be an important part of the content, but I was only asked once in the interview of Alibaba B2B Business Division, when I asked about decoration 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.

Multithreading this is also a must ask. 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. (You can leave a message to discuss what method is used to achieve)

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.

10, JDK source code to get a high salary, JDK source code must 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 how to implement the hashCode method of String. 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, The CAS mechanism and AtomicInteger is how to use CAS mechanism (4) the implementation principle of the thread pool (5) Object class methods 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. Welcome Java engineers who have worked for one to five years to join Java architecture development: jq.qq.com/?_wv=1027&k…

This group provides free study guidance framework materials and free solutions

If you don’t know any questions, you can ask them in this group. There will also be career planning and interview guidance

At the same time, we can pay more attention to the small series to learn and progress together