Five years of CRUD programmers, the whole process of successfully landing 360 from outsourcing;

Write in front


Today I am sharing a summary of the interview experience of a Java engineer with 5 years of work experience in Imperial Capital. I will see what questions these Internet companies like to ask. I hope it will be of instructional significance to everyone's interview.

I also have 5 years of experience in Java development. I started my interview experience trip in early April. About 20 days later, I had interviews with major Internet companies, first- and second-tier large companies or startups in financing, and I got some offers. Including Qihoo 360, etc.

First of all, different interviewers must have different interview styles. Here is a summary of most of the problems in the Java development process during interviews these days. The comprehensive classification includes Java foundation, framework, multithreading, network communication, database and design patterns, algorithms and other modules.

The skills that a Java programmer with 3 years of work experience should have, this may be the content that Java programmers care about. I want to explain here that the content listed below is not something that you must know-but if you master the more, the final evaluation and salary you can get will definitely be higher.

One, Java basics

  1. Why the String class is final.
  2. HashMap source code, implementation principle, and underlying structure.
  3. In reflection, the difference between Class.forName and classloader
  4. The difference and connection between session and cookie, the life cycle of session, and session management when multiple services are deployed.
  5. What are the queues in Java and what are the differences.
  6. Java's memory model and GC algorithm
  7. The operation efficiency of the two structures of Java array and linked list, under which conditions (starting from the beginning, starting from the end, starting from the middle), which operations (insert, find, delete) are efficient
  8. Investigation and positioning of Java memory leaks: the use of jmap, jstack, etc.

Two, multithreading

This is also a must. Because of three years of work experience, I will basically not ask you how to implement multi-threading. I will ask more about the difference and connection between Thread and Runnable, what happens when a thread is started multiple times, and what state the thread has. Of course, this is only the most basic. Unexpectedly, the same question was asked almost at the same time in several interviews. The way to ask is not the same. In summary, this means:

If there are four threads Thread1, Thread2, Thread3, and Thread4 to count the sizes of the four disks C, D, E, and F respectively, and all the threads are counted and handed over to the Thread5 thread for summary, how should this be achieved?

Do smart netizens have an answer to this question? Not difficult, there are ready-made classes available under java.util.concurrent.

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

Finally, although there are not many questions in this interview, multi-thread synchronization and locking are also the key points.

The difference between synchronized and ReentrantLock, the normal method of synchronized lock and the static method of lock, the principle of deadlock and the troubleshooting method, etc. Regarding multithreading, I have summarized the interview questions of multithreading and concurrent programming in some previous articles!

 

Friends who need the documents and interview materials in the article can like this article and add the assistant vx: bjmsb10 to get it for free;

 

三 、 I.

IO is divided into File IO and Socket IO. File IO is basically not asked, and there is nothing to ask. It is fine to use it normally, and remember that File IO is all blocking IO.

Socket IO is a more important piece. What we need to understand is the difference between blocking/non-blocking, synchronous/asynchronous, and to understand the four IO models of blocking IO, non-blocking IO, multiplexing IO, and asynchronous IO. How does Socket IO relate to these four models.

This is more basic. If you go deeper, you will ask about the principle of NIO, which IO model does NIO belong to, the three major components of NIO, etc. This is a bit difficult. At that time, I also studied NIO for a long time. Just to mention, NIO is not strictly non-blocking IO but should be multiplexed IO. Pay attention to this detail when answering the interview. Talking about NIO will block in the Selector select method will increase the interviewer’s favor of you. .

If you have used Netty, you may ask about Netty. After all, this framework is basically the best NIO framework (Mina is actually good, but overall it is still not as good as Netty), and most Internet companies are also in Use Netty.

Four, 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 to see if you usually like to delve into it. In the process, I was asked a lot of questions about the JDK source code. One of the most tricky one asked, how is String's hashCode() method implemented. Fortunately, I usually read a lot of String source code, and I answered it roughly. The JDK source code is actually nothing to summarize. It is purely personal, and summarize the more important source code:

  1. Source code of List, Map, Set implementation classes
  2. Source code of ReentrantLock, AQS
  3. The realization principle of AtomicInteger, mainly to explain the CAS mechanism and how AtomicInteger is implemented using the CAS mechanism
  4. The realization principle of thread pool
  5. The methods in the Object class and the role of each method

These are actually quite demanding. Last year, I basically studied the source code of important classes in the JDK. It really took time and effort. Of course, it’s worth looking back—not just for the interview. .

Five, frame

  1. Which jar packages need to be referenced in the spring framework and the purpose of these jar packages
  2. Principle of srpingMVC
  3. The meaning of springMVC annotations
  4. The connection and difference between beanFactory and ApplicationContext in spring
  5. Several ways of spring injection
  6. How does spring realize things management
  7. Principles of springIOC and AOP
  8. The way of cyclic injection in spring

 

 

Six, the database

The database will also ask about it all the time. Some basics like the difference between union and union all, left join, several indexes and their differences will not be discussed. 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, I suggest you Spend a day or two before the interview to prepare the content of SQL basics and SQL optimization.

But don’t worry about the database. A company often has many departments. If you are not familiar with the database and the basic technology is very good, Jiucheng will want you. It is estimated that you will be placed in a department that does not require very high database usage. Exercise.

 

 

Seven, data structure and algorithm analysis

Data structure and algorithm analysis are better than not for a programmer, and they can definitely come in handy at work. Arrays and linked lists are the foundation. Stacks and queues are a bit deeper 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 must know what a binary search tree is. What is a balanced tree, the difference between AVL tree and red-black tree. I remember an interview, an interviewer talked to me about the index of the database, he asked me:

Do you know which data structure is used to implement the index?

Answer the Hash table used, the answer is wrong. He asked again, do you know why you want to use trees? Answer: Because the Hash table may have more conflicts, in the face of tens of millions or even hundreds of millions of data, it will greatly increase the time complexity of searching. The tree is relatively stable, and it is basically guaranteed that the data you want can be found 20 or 30 times at most. The other party said that it was not completely correct. In the end, we talked about this issue, and I also understood why the tree was used.

Eight, JVM

Unexpectedly, the Java virtual machine should be a very important piece of content. As a result, the probability of being asked in these companies is almost zero. You know, last year, I spent a lot of time studying the Java virtual machine. I have read more than five times of "In-depth understanding of the Java virtual machine: JVM advanced features and best practices" by Mr. Zhou Zhiming.

Closer to home, although I didn't ask about the Java virtual machine, I think it is necessary to study it, so I will simply make an outline and talk about the more important content in 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 rule
  6. volatile keyword usage rules

Maybe the interview is useless, but on the way to becoming a big cow, it’s a must. This is the interview with several companies and finally compiled these interview questions. The interview determines your salary. You must treat it well. These questions may not I will ask, but the programmers are not so skilled, and finally received an offer from Baidu, the salary is not bad, I shared these interview questions and hoped to help those who plan to change jobs~~

 

Friends who need the documents and interview materials in the article can like this article and add the assistant vx: bjmsb10 to get it for free;

 

Learn and encourage

At the same time, the golden three and the silver four have passed. As far as the current domestic interview mode is concerned, it is very important to actively prepare for the interview before the interview. It will become very important to review the entire Java knowledge system. You can be very responsible to say whether the review is adequate , Will directly affect your success rate of entry. But many friends suffer from not having appropriate information to review the entire Java knowledge system, or some friends may not know where to start the review. I accidentally got a collated material, whether from the entire Java knowledge system or from the perspective of the interview, it is a highly technical material (PDF version).

How to get free information:

Friends who need the documents and interview materials in the article can like this article and add the assistant vx: bjmsb10 to get it for free;

 

 

More architecture topics and video materials are displayed as follows:

 

 

 

Friends who need the documents and interview materials in the article can like this article and add the assistant vx: bjmsb10 to get it for free;

Guess you like

Origin blog.csdn.net/Java0258/article/details/112369254