JD Java is a ten-year veteran, summarizing the work, job-hopping, and interview experience of these years

Pay attention, don’t get lost; continue to update Java related technologies and information! ! !

Preface

A week ago, a former colleague came to me for a business trip. He made an appointment to find a place to eat. He talked about the current work and life while pushing the cup and changing the cup. I talked about being in Jingdong before and now starting a business. The journey is bumpy!
Anyway, I’m bragging*, he’s really awesome*! I talked about the job, job-hopping, interview experience, today I have time to organize and share! Hope it helps you!
Insert picture description here

about work

How to show the highlights, techniques or difficulties in your project:

It is fine to sum up my experience and technology, but the projects I have done and the technology I know are so mediocre, what should I do if I can’t find any bright spots?

If you know that you have no bright spots, that is, you know what you are lacking, then you will try to create bright spots for yourself next time you quit and make up for your shortcomings.

For example, you can find a big data job, so you will have a big data technology label in the future, which is your highlight. Or you can find a project with high concurrency to do it, so that you will have the experience of high concurrency projects in the future, which is also your highlight.

All in all, every time you change jobs and interviews, it is more valuable to keep summarizing yourself and digging deeper into your own highlights than to brush those boring interview questions. This will not only help your present, but also your future.

About the interview

It is not recommended to review the questions before the interview, but you need to summarize the highlights and techniques of the project. Also need to review the key points of knowledge that have been forgotten.

Interview questions

Insert picture description here
The first stage is the main language itself and its advanced features, and the second stage is to talk about one's own project, interspersed with questions.

1) The realization principle of Java data structure-related classes, such as LinkedList, ArrayList, HashMap, TreeMap. The following simply simulates a serial gun with a data structure.

For example, the interviewer first asks you if HashMap is in order?

You definitely answer that it is not orderly. The interviewer will continue to ask you, is there a sequential Map implementation class?

If you say you don't know at this time, then this question is over. If you say there are TreeMap and LinkedHashMap.

Then the interviewer may ask you next, how does TreeMap and LinkedHashMap guarantee its order?

If you can't answer, then stop here. If you still answer, the interviewer will continue to ask you, which one of them do you think is better in orderly implementation?

If you can still answer, then the interviewer will continue to ask you, do you think there is a better or more efficient way to implement it?

If you can say it, then you can still ask you a lot of questions about the implementation you said.

The above is an example of an interviewer asking questions step by step. So, if you don’t know much, don’t perfuse, because the next problem may be exposed. It’s better to just say no, put this problem over, and quickly switch to a field you’re familiar with.

2) The classes in the Java concurrent package, what are their functions, and their implementation principles, these classes are under the java.concurrent package. As above, let's simply simulate a serial cannon with concurrent packages.

For example, the interviewer may first ask you, if you want to realize that all threads wait for an event to occur together, when an event occurs, all threads start execution together, is there any good way?

At this time, you might say that you can use a barrier (CyclicBarrier in Java's concurrency package), then the interviewer will continue to ask you, do you know how it works?

If you continue to answer, the interviewer may continue to ask you, do you know other ways to achieve it?

If you can name many ways to achieve it, then continue to ask you, which of these methods do you think is better?

If you say that a certain method is better, the interviewer can still ask you, if you are asked to write, do you think there is a better way to achieve it?

If you can still say your own better way to achieve this at this time, then the interviewer will definitely grab this and continue to ask you.

This is the reason why we should guide the interviewer during the interview. Because the interviewer’s questions are often traceable, if you catch his track and can guess what he is likely to ask below, then you can go in the direction you want to talk about when answering. To speak. In this way, the interview will be more calm and more comfortable.

3) The content in the IO package and the NIO package. In this part, NIO will be the focus, most of the IO packages will be familiar, so you may skip it directly and ask you directly about the content of NIO.

The content of the IO package and the NIO package are relatively small. First of all, the NIO model must be familiar, especially the selector must be very clear about its responsibilities and implementation principles. In fact, the core of NIO is the IO thread pool. We must remember this key point. Sometimes, the interviewer may also ask you the design pattern (decorator pattern) of the IO package, why do you design it this way?

Some interviewers will also ask you if you have a better design. At this time, if you don’t know, please say decisively that your current level is limited and you can’t come up with a better design. Don’t just babble and yell at it.

4) The contents of the Java virtual machine. This part mainly includes three parts, GC, class loading mechanism, and memory.

A simple serial cannon for the GC part.

The interviewer can first ask you when an object will be GC?

Then continue to ask why do you want the object to be GC at this time?

Then continue to ask you what are the classifications of GC strategies?

If you say it, continue to ask you what are the advantages and disadvantages of each of these strategies? What scenarios are they suitable for?

After you continue to speak out, give you a practical scenario and let you choose a GC strategy?

If you are selected, continue to ask you, why did you choose this strategy?

Below is a simple serial shot about the class loading mechanism.

First of all, I must first ask you what are the Java class loaders?

After answering these, you may be asked which classes are loaded by each class loader?

After speaking, you may ask you what is the parent-child relationship between these class loading?

You may mention the parental delegation model when you answer, so you can continue to ask you what is the parental delegation model?

After you have explained it, you may continue to ask you, why does the Java class loader use the parent delegation model?

After you answer, you may continue to ask you how to customize your own class loader, how to deal with the relationship between your own class loader and Java's own class loader?

Here is another serial cannon about memory.

First of all, I must ask you which parts of the memory are divided into, and what data are stored in these parts?

Then continue to ask you how an object survives and moves in these parts from creation to destruction?

Then you may be asked, which parts of the memory will participate in GC recovery?

After finishing the work, you may also ask you how the Java memory model is designed?

After you answer, you will continue to ask why you designed this way?

After asking, maybe you can talk about the role of the volatile keyword in combination with the design of the memory model?

When you are talking, you will definitely mention visibility. Then, following the three words visibility, you can continue to ask about your concurrent content.

Basically, the Java language itself and the slightly more advanced content of the language are the above parts. If you can understand the above four parts very thoroughly, then basically there is no problem with the Java part, because the above content alone is enough for you to interview. The officials have been chatting for a long time. If you talk about these for a long time, naturally the time to ask you other questions will be shorter.

You should be able to feel it from the process of writing these questions. In many cases, the interviewer asks along a line. If you feel that this line is not familiar to you, you should turn around and guide the interviewer to go. Ask other questions. Don't keep going down until you can't jump out, then it will be embarrassing.

2. Tell about your project, interspersed with questions

This part is a must-question during the interview process, and it is also the longest conversation stage. Unless your previous language part is very solid, until the interviewer asks for an hour or two, you still haven't found out how deep your understanding of the language itself is. Otherwise, you must not be able to escape the level of your own project, and under normal circumstances, the chat time will not be too short.

The general pattern of this part of the content is that you talk about the projects you have done yourself, and then the interviewer will be abruptly asking you to explain a certain part of it, such as asking you to explain why you did it at the time, or asking you if you think it is better now. Good way. Most of these interspersed problems are related to the technology used in your project. And what you need to do is to fully and fully summarize the projects you have done (especially the most recent one or two projects), and dig out one or even N bright spots, so that the interviewer will be able to make the most of them. Bright feeling. If you can achieve this effect, you are basically not far from success.

This part of the content is closely related to each person's own experience, so there is no way to list the possible questions here. This article "Programmer's Face: Should I Brush Questions Before the Interview and How to Prepare Before the Interview" was written by me before. It probably discussed how to summarize before the interview. If you are interested, you can find out.

3. Additional bonus points

The above two stages are basically necessary, and there are some extra points. Among these bonus items, the interviewer will also ask you about some content (such as TCP/IP protocol, algorithm), but more will ask you if you understand, if you understand, continue to talk, if you don’t understand, just ignore it. After that, you will not be directly sent to hell because of this problem.

Below I list these bonus points, if possible, these bonus points still have to fight.

1. Principles of computer systems.

2. Network communication protocol (TCP/IP, HTTP, etc.).

3. Data structure and algorithm.

4. The source code of famous open source projects.

5. You have a great open source project yourself.

6. Your personal blog.

7. To be added in the comment area.

Among these items, for the first 1-3 items, if you have a good understanding before, but you have forgotten it due to time issues, you can still hold your feet. As for the following 4-6 items, you need to accumulate daily, which cannot be done in a short while. If you don't accumulate in weekdays, then these three bonus items can only be discarded.

4. Content related to your position

In fact, this last item is a supplement to the first three items. You should try to focus on content related to the position you are interviewing for. For example, if you are interviewing for a position in real-time computing, your algorithm should be good, you should be familiar with well-known real-time computing open source projects, it is best to read the source code, and you should also have certain insights into distributed systems.

Therefore, this part 4 has no specific content, but just reminds you that if you are very clear about your interview position, it is best to move closer to the demand of the position when preparing for the interview, so that the possibility of success is greater.

The road is underfoot, come on!

welfare

How to receive benefits at the end of this article
Why is Redis single-threaded so fast?
https://blog.csdn.net/XingXing_Java/article/details/92626174

If you think it is helpful to you, please give me a thumbs up, and comments to encourage me!

Guess you like

Origin blog.csdn.net/XingXing_Java/article/details/93008104