Hello everyone, I’m Brother Tom.

In terms of this year’s environment, the difficulty of job hopping success is much higher than in previous years, and an obvious feeling is that this year’s Java technology stack interview, whether on one side or two, has particularly tested the technical skills of Java programmers.

Today, let’s talk about some of the experience sharing of the interview, I hope you can provide some help

Original post link: https://www.zhihu.com/question/414988138/answer/2181576552

1) Don’t make people feel that you will only copy other people’s code

Frameworks are the focus, but don’t make it feel like you’re just copying someone else’s code! Before the interview, the interviewer will generally read the resume to see the candidate’s project experience in the framework, and in the candidate’s project introduction, the interviewer will also focus on the candidate’s recent framework experience, which is currently more popular with SSM.

However, most of the candidates who work within 5 years can only “copy” other people’s code, that is to say, they can expand new functional modules on the basis of the existing framework and follow the process written by others. For example, the functional module to write a pending stock order will imitate the existing order process, and then from the front end to the back end to the database, write it again, and at most change the code points related to the function.

In fact, each of us comes this way, but in the interview, if you only show such ability, it is similar to the level of most people, and you will not be able to reflect your advantages at this point.

We know that most projects have pain points if they use SSM frameworks alone. For example, the database performance is poor, or the business module is more complex, and the concurrency is relatively high, and the controller in Spring MVC cannot meet the needs of the jump. So when I was interviewing, the interviewer also asked a question: What changes have you made besides writing business code according to the existing framework?

My answer is: add the Redis cache to avoid frequent calls to some constant data. Or, in MyBitas’s xml, where the select statement has a null condition, that is, this value adds a where condition, for which, a query condition without is null will be added to any where, so as to avoid the statement from doing a full table scan when the incoming argument is null. Or, to put it simply, the backend asynchronously returns a large amount of data for a long time, and I have increased the maximum time returned asynchronously in the project, or compressed the returned information to increase network transmission performance.

For this question, in fact, most interviewers do not care what answer they hear, only care about whether the answer is logical or not. Generally, as long as the answer is correct, the interviewer will give the judgment of “having his own experience at the framework level and having a certain understanding”, otherwise, he will only give “can only write the framework code under the leadership of the project manager, and do not know much about the framework itself”.

In fact, when preparing for the interview, it is not difficult to summarize the main points in the framework, I don’t believe that everyone has no accumulation when doing the project, as long as you say it, you can say that in this regard, you have crushed nearly 70% of the competitors.

Don’t just look at the stand-alone version of the framework, properly understand some distribution! In addition, when describing the framework technology in the project, it is best to bring some distributed technology. Below I will list some distributed technologies that you can prepare.

1. In terms of reverse proxy, the basic configuration of nginx, such as how to set rules through the lua language and how to set session stickiness. If you can, look at the bottom layer of nginx, such as protocol, cluster settings, failover, etc.

2, remote call dubbo, you can look at the knowledge points of dubbo and zookeeper integration, and then go a step further to understand the underlying transmission protocol and serialization method of dubbo.

3, the message queue, you can look at the use of kafka or any of the components, simple point can look at the configuration, the settings of the working group, and then go deeper, you can look at the Kafka cluster, the way of persistence, and send messages with a long connection or short interception.

The above is just an example of 3 components, you can also look at the Redis cache, log framework, MyCAT database sharding table, etc. There are two main types of preparation, the first is to know how to use, which is relatively simple, can be built into a functional module through the configuration file, and the second is to read some low-level code appropriately to understand the protocol, clustering and failover and other advanced knowledge points.

If you can talk about the bottom layer of distributed components in the interview, then the evaluation will be better, such as “deep understanding of the bottom layer of the framework”, or “experienced framework”, so that even if you interview the architect, let alone advanced development.

In terms of database, don’t know the addition, deletion and correction, you have to understand the performance optimization! In a real project, most programmers may only use additions, deletions, and censorships, which is more common when we use Mybadis. However, if you behave this way in interviews, it is estimated that your ability is similar to that of other competitors.

In this regard, you can prepare the following skills:

Advanced aspects of SQL, such as group by, having, left join, subqueries (with in), row to column, and other advanced usages.

In terms of table building, you can consider whether your project uses three normal forms or anti-normal forms, and what is the reason?

Especially for optimization, you can prepare how to view the improvement points of SQL statements through the execution plan, or other ways to improve SQL performance (such as indexing, etc.).

If you feel that you have the ability, you can also prepare some MySQL clusters, MyCAT database sharding and table skills. For example, MySQL load balancing is implemented through LVS + Keepalive, and the configuration method of MyCAT. Again, if you can, look at some of the relevant underlying code.

Even if you are average in the first three points, then at least you can surpass nearly half of the candidates, especially if you are very good at SQL optimization, then you must be up to the standard when you interview for advanced development, and if you answer even the fourth point very well, then congratulations, your ability in database is even up to the level of junior architecture.

Java core aspects, around the data structure and performance optimization to prepare interview questions! Java core, there are many interview questions on the Internet, but in addition to this, you should also focus on the collection (that is, data structures) and multi-threaded concurrency of these two blocks, on this basis, you can prepare some design patterns and virtual machine rhetoric.

Here are some of the questions I usually ask:

String a = “123”; String b = “123”; What is the result of a==b? This includes many knowledge points such as memory, String storage mode, etc.

When do the hashcode and equal methods in HashMap need to be overridden? What happens if I don’t rewrite it? You can learn more about the underlying implementation of HashMap (or even ConcurrentHashMap).

What is the difference between the underlying implementations of ArrayList and LinkedList? Where are they suitable? You can also understand the relevant underlying code.

What does the volatile keyword do? From this expansion, we can understand the difference between thread memory and heap memory. volatile keyword parsing.

CompletableFuture, this is a new feature in JDK 1.8, how to achieve multi-threaded concurrency control through it?

In the JVM, where is the new object located? Go a little deeper and ask how to view and optimize JVM virtual machine memory.

What is the difference between a static proxy and a dynamic proxy in Java? It’s best to combine it with the underlying code.

Through the above question points, in fact, we will find that not only staying at the “will use” level, the interviewer of the big factory will not ask how to put elements in the ArrayList. As you can see, the above questions include details such as “multi-threaded concurrency”, “JVM optimization”, “underlying code of data structure objects”, etc., and you can also learn from each other by looking at some advanced knowledge and preparing more similar interview questions.

We know that the current Java development is based on Web frameworks, so why ask the Java core knowledge points? I have experienced this first-hand.

Before in my team, I have seen two people, one is that he can work, the specific performance is to use the Java core basic API, and there is no willingness to understand it (I don’t know how to understand it), and the other usually looks at some advanced knowledge of Java concurrency, virtual machines, etc.

After half a year, the latter’s capabilities were quickly upgraded to advanced development, and because of the thorough understanding of the core knowledge points of JAVA, it was no big problem to look at the underlying implementation of some distributed components. The former, on the other hand, has been working repeatedly, and the ability has only remained at the level of “can work”.

In the real interview, if you are not familiar with the core knowledge points of Java, it is estimated that it is difficult to upgrade to advanced development, let alone interview architect-level positions.

In terms of Linux, at least know how to see the logs to troubleshoot problems! If the candidate can prove that he or she has the ability to “troubleshoot problems” and “solve problems”, this is definitely a plus, but how to prove it?

At present, most Internet projects are deployed on Linux, that is, the logs are in Linux, and some actual Linux operations are summarized below. Common Linux commands that Java programmers must master.

You can open the file with the less command, reach the bottom of the file by Shift+G, and search for information based on the key by means of the ?+ keyword.

You can check the keyword by grep way, the specific usage is, grep keyword filename, if you want to find it twice in the result, use grep keyword 1 filename keyword 2 –color. Finally – color is the highlighted keyword.

Can edit files via vi.

You can set the permissions of the file through chmod.

Of course, there are more practical Linux commands, but in the actual interview process, many candidates do not know even a Linux command. Or this sentence, even if you know something very basic, you are better than the average person.

How to prove that you know a good knowledge point? There is nothing more than being able to illustrate it through the underlying code. When I was talking to a lot of programmers with 5 years of work experience, many people thought it was difficult. It is true that it is not difficult to understand distributed components by reading the underlying code, but it is not difficult to understand the underlying code as follows.

The underlying code of ArrayList and LinkedList contains implementations based on arrays and linked lists, and if you can explain the expansion clearly, “traversing through the enumerator” and so on, you can definitely prove yourself.

HashMap directly corresponds to the data structure of the Hash table, and in the underlying code of HashMap, it contains the operation of put, get, etc. of Hashcode, and even in ConcurrentHashMap, it also contains the logic of Lock. I believe that if you look at the ConcurrentHashMap in the interview, and then combine it with the paper while speaking, you will definitely be able to conquer the interviewer.

You can look at the implementation of static agents and dynamic agents, and then go a little deeper, you can look at the implementation code in Spring AOP. Details the three proxy patterns in Java.

Maybe the underlying implementation code of Spirng IOC and MVC is difficult to understand, but you can say some key classes, according to the key process to say how they are implemented.

In fact, the underlying code is not necessarily prepared, and it is not limited to which aspect, such as the collection based on the red and black tree, the open source framework based on NIO, and even the Dubbo of distributed components. And you don’t have to memorize all the underlying layers when preparing (which is actually difficult to do), you just need to be able to combine some important classes and methods and explain the idea clearly (such as how HashMap can be quickly located through hashCode).

So in the interview, how do you find a good opportunity to say the above underlying code that you have prepared? In the interview, there will always be a question about the collection, Spring MVC framework and other related knowledge points, when you answer, by the way, “I still understand the underlying implementation of this piece”, then the interviewer will definitely ask, then you can say it.

Don’t underestimate the help to the candidate, once you have spoken, as long as the meaning is in place, then at least you can get a “willing to be professional” evaluation, if the description is clear, then the evaluation will be upgraded to “familiar with Java core skills (or Spring MVC), and the basic skills are solid”.

You know, in the interview, very few people can explain the underlying code, so you throw this topic, even if the end does not achieve the expected effect, the interviewer will not lower the evaluation of you. Therefore, preparing this piece is definitely a profitable and harmless” money-making transaction

All of them, embed the above skills into the projects you’ve done! During the interview, many candidates were very good at speaking about SQL optimization skills, but in the end they learned that these were things he usually taught themselves and were not used in actual projects.

Of course, this is better than not saying it, so I will write in the interview “I have taught myself SQL optimization skills in normal times”, but if I have practiced in the project, then I will write “I have the skills of actual database SQL optimization”. You can compare the difference between the two, one is partial theory, and the other is directly able to work. In fact, in many scenarios, I don’t believe that I have not practiced SQL optimization skills in the actual project.

From this case, I want to tell you that a lot of skills and rhetoric that you have worked so hard to prepare (in fact, the direction of the method is obtained, and it does not take much effort) should finally be implemented into your actual project.

For example, if you have experience in querying keywords in Linux logs to troubleshoot problems, you can include a sentence when describing, which I did in the previous project. For example, if you look at the underlying code and understand the difference between TreeSet and HashSet and their scope of application, then you can recall the project you did before, is there a scenario that only applies to TreeSet?

If there is, then you can properly describe the requirements of the project, and then say, by reading the underlying code, I understand the difference between the two, and in this actual demand, I used TreeSet, and I also did a special comparative experiment and found that using TreeSet is xx percentage points higher than HashSet.

Keep in mind that “practical experience” must be worth more than “theoretical experience”, and most of the theoretical experience you know must have been used in your project. So, if you just make the interviewer feel like you only have “theoretical experience,” that’s a loss.

About me: Brother Tom, a former Ali P7 technical expert, offered harvesters, participated in many Taobao Double 11 promotion activities. Welcome to pay attention, I will continue to output more classic original articles to help you advance to the big factory

WeChat 8.0 will let go of friends to ten thousand, small partners can add my size, first-come, first-served, and then full is really gone. Scan the QR code below to add me WeChat, 2022, hug the group for warmth, and work together to be bullish.