Home > headlines > body text

Skills a Java programmer with 3 years of work experience should possess

-
Release: 2018-03-13 09:57:58
Original
1625 people have browsed it

The skills that a Java programmer with 3 years of work experience should possess. This may be something that Java programmers are more concerned about. I want to explain here that not everyone listed below is something that everyone knows - but the more you master it, the higher the evaluation and salary you will get in the end.

1. Basic syntax

This includes the functions of static, final, transient and other keywords, the principle of foreach loop, etc. In today's interview, I asked you what the static keyword does. If you answer static modified variables and modified methods, I will think you are qualified. If you answer static block, I will think you are good. If you answer static inner class, I will think you are good. , I will be very satisfied with your answer to the static guide package, because I can see that you are very keen on researching technology.

The most in-depth time, I remember the interviewer directly asked me about the underlying implementation principle of the Volatile keyword (by the way, interviewing and being interviewed are relative in themselves. The interviewer can ask this question and the interviewer also I feel that the interviewer is also a person who likes to study technology, which increases the interviewer's good impression of the company. I finally chose the company that asked this question). Don't think this is too picky - the simpler the question, the more obvious it is. Depending on a person's level, others' consideration of your technology is mostly based on depth first, breadth second, remember.

2. Collection

is very important and must be asked. Basically, they are List, Map, and Set. They ask about the underlying implementation principles of various implementation classes and the advantages and disadvantages of implementation classes.

What collections need to master is the implementation principles of ArrayList, LinkedList, Hashtable, HashMap, ConcurrentHashMap, and HashSet. If you can answer the questions fluently, it would be great if you can master the CopyOnWrite container and Queue. In addition, ConcurrentHashMap questions are asked a lot in interviews, probably because this class can generate a lot of questions. Regarding ConcurrentHashMap, I will provide netizens with three answers or research directions:

(1)ConcurrentHashMap’s lock segmentation technology.

(2) Whether the reading of ConcurrentHashMap needs to be locked and why.

(3) Is the iterator of ConcurrentHashMap a strongly consistent iterator or a weakly consistent iterator.

3. Framework

It’s a cliché, something that must be asked in interviews. Generally speaking, they will ask you about the framework used in your project, and then give you some scenarios to ask you how to use the framework. For example, if I want to do something when Spring initializes the bean, what should I do? If I want to destroy the bean, How to do something, the difference between $ and # in MyBatis, etc. These are all relatively practical. It will not be a problem if you have accumulated good knowledge and learned the details of using the framework.

If you answer the above questions well, the interviewer will often ask in-depth questions about the implementation principles of some frameworks. The most frequently asked question is the implementation principle of Spring AOP. Of course, this is very simple. It can be done in two sentences, even if you don't know how to prepare it. The most perverted thing I encountered was asking me to draw the UML diagram of Spring's Bean factory implementation. Of course, I would never be able to answer such a profound question/(ㄒoㄒ)/~~

4. Database

The database will most likely be asked. I won’t talk about some basic things like the difference between all, left join, several indexes and their differences. The more important thing is the optimization of database performance. If you don’t know anything about database performance optimization, then if you have time, it is recommended that you do it before the interview. Spend a day or two specifically preparing the basics of SQL and SQL optimization.

But don’t worry about the database. A company often has many departments. If you are not familiar with databases and have very good basic skills, 90% of them will want you, and they will probably put you in the database first. It is not a very demanding department to exercise.

5. Some questions about the Web

Java is mainly oriented to the Web side, so some questions about the Web must also be asked.

The two most frequently asked questions I have encountered are:

Talk about several implementation methods of distributed Session.

Being able to answer the four commonly used questions will naturally make the interviewer very satisfied.

Another frequently asked question is: Let’s talk about the difference and connection between Session and Cookie and the implementation principle of Session. In addition to these two questions, the content in web. In addition, some details such as the difference between get/post, forward/redirect, and the implementation principle of HTTPS may also be examined.

6. Data structure and algorithm analysis

For a programmer, data structure and algorithm analysis is better than not and it can definitely come in handy at work. Arrays and linked lists are the basis. Stacks and queues are more in-depth but not difficult. Trees are very important. The more important trees are AVL trees and red-black trees. You don’t need to know their specific implementation, but you need to know what a binary search tree is. What is a balanced tree, the difference between an AVL tree and a red-black tree. I remember an interview, an interviewer talked to me about the index of the database, and he asked me: Do you know which data structure is used to implement the index?

I answered the Hash table I used, but I got it wrong. He asked again, do you know why trees are used? I answered that it is because there may be more conflicts in the Hash table, which will greatly increase the time complexity of the search in the face of tens of millions or even hundreds of millions of data. The tree is relatively stable and can basically guarantee that you can find the data you want at most twenty or thirty times. The other party said that it was not completely right. Finally, we exchanged this issue and I also understood why we should use the tree. I won’t go into it here, but my friends, netizens Why do you think indexes need to be implemented using trees?

As for algorithm analysis, just forget it if you don’t know or don’t want to study it. I remember an interviewer asked me what kind of sorting method the Collections.sort method uses, um. , vomited three liters of blood. Of course, in order to show that I am knowledgeable and have done some research on algorithm analysis (⊙﹏⊙)b, I still bite the bullet and say that it may be bubble sorting. Of course the answer is definitely not. Interested netizens can take a look at the source code of the Collections.sort method, which uses a sorting method called TimSort, which is an enhanced merge sorting method.

7. Java Virtual Machine

To my surprise, Java Virtual Machine should be a very important piece of content. As a result, the probability of being asked about it in these companies is almost 0. You know, I spent a lot of time studying the Java virtual machine last year. I read "In-depth Understanding of the Java Virtual Machine: JVM Advanced Features and Best Practices" by Teacher Guang Zhou Zhiming no less than five times.

Getting back to the subject, although I didn’t ask about the Java virtual machine, I think it is still necessary to study it. I will simply make an outline and talk about the more important contents of the Java virtual machine:

(1)Memory layout of Java virtual machine

(2)GC algorithm and several garbage collectors

(3)Class loading mechanism, which is the parent delegation model

(4)Java memory model

(5)happens-before rules

(6)volatile keyword usage rules

Maybe the interview is useless, but when you become a great person On the road, it is a must.

8. Design pattern

I originally thought this was a very important piece of content, but I was only asked about it once during an interview at Alibaba B2B Division. The question was about the decorator pattern.

Of course we can’t be so utilitarian and learn for the interview. Design patterns are still very important and useful at work. Among the 23 design patterns, just focus on the ten commonly used ones. About design during the interview Questions and answers on patterns are mainly in three directions:

(1) Which design patterns are used in your project and how to use them.

(2) Know the advantages and disadvantages of commonly used design patterns.

(3) Be able to draw UML diagrams of commonly used design patterns.

9. Multi-threading

This is also a must-ask question. Because of three years of work experience, I will basically not ask you how to implement multi-threading. I will ask you more in-depth questions, such as the difference and connection between Thread and Runnable, what will happen if you start a thread multiple times, and what status the thread has. Of course, this is just the most basic. Unexpectedly, I was asked the same question almost at the same time in several interviews, with different ways of asking it.

To sum up, this means:

If there are four threads, Thread1, Thread2, ThreaD3, and Thread4, respectively counting the sizes of the four disks C, D, E, and F, all threads will be counted. How to implement the summary by handing it to Thread5 thread?

Do smart netizens have an answer to this question? It is not difficult, there are ready-made classes under java.util.concurrent that can be used.

In addition, thread pools are also a frequently asked question. How many commonly used thread pools are there? What are the differences and connections between these types of thread pools? What is the implementation principle of thread pools? More practical ones , will give you some specific scenarios and let you answer what kind of thread pool should be used in this scenario.

Finally, although not many questions were asked in this interview, multi-thread synchronization and locking are also the focus. The difference between synchronized and ReentrantLock, the common method of synchronized lock and the static method of lock, the principle and troubleshooting method of deadlock, etc.

10. JDK source code

If you want to get a high salary, you must read the JDK source code. The above content may also be related to specific scenarios. The JDK source code is just to see if you like to delve into it. During the interview, I was asked a lot of questions about the JDK source code. The most tricky one asked me how String's hashCode() method is implemented. Fortunately, I usually read a lot of String source code and gave a rough answer.

There is actually nothing to summarize about the JDK source code. It depends purely on the individual. Let’s summarize the more important source code:

(1) Source code of List, Map and Set implementation classes

(2) Source code of ReentrantLock and AQS

(3) The implementation principle of AtomicInteger, which mainly explains the CAS mechanism and how AtomicInteger is implemented using the CAS mechanism

(4) Thread pool Implementation Principles

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

These are actually quite demanding. I basically studied the source code of important classes in the JDK throughout last year It really takes time and effort to go through everything, but of course, looking back, it's worth it - not just to cope with the interview.

Finally, if you are interested and have time, it is recommended to study and study SOA and RPC, which are service-oriented systems and are necessary for large-scale distributed architectures. They are life-saving recipes that can cure all diseases and have been tried and tested.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template