This article authorized reprinted from: www.cnblogs.com/JavaArchite… .

Awesome-java:github.com/Snailclimb/… (A great collection of Java open source projects on Github)

My interview criteria

Over the past week, I’ve intensively interviewed a number of candidates with 3 to 5 years of experience on the Java backend. My criteria are not complicated:

  1. First, to work;

  2. Second, the Java foundation is good;

  3. Third, be familiar with distributed frameworks;

I believe other companies should follow this standard when hiring entry-level developers.

I also know a lot of candidates who are not that bad, but don’t prepare or speak up during the interview. Such people may actually meet expectations after joining the team, but they may not pass the interview, but the interviewer will always judge them based on the interview.

But the reality is that most people probably don’t prepare for an interview, or prepare in the wrong way. You know, we usually work more focused on business, so we are not likely to be exposed to a lot of algorithms, data structures, underlying code and other interview questions. In other words, the interview preparation points and the main points of the job do not match.

As the interviewer, I can only decide the interview result according to the candidate’s answer. However, it’s easy to make it easier for yourself, so in this article, I’ll use some common questions to help you prepare for an interview. After reading, we will sigh: as long as the method is appropriate, the first is not difficult to prepare for the interview, and the second time is not too much.

Frameworks are important, but don’t look like you’re just copying someone else’s code

Before the interview, I will read the resume to check the candidate’s project experience in framework. During the introduction of the candidate’s project, I will also focus on the candidate’s recent framework experience. The most popular one is SSM.

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

We all do that, but if you just show that you’re on par with most people in an interview, you won’t be able to show that you’re good at it.

We know that most projects will have pain points if the SSM framework is used alone. For example, the database performance is poor, or the business module is complex and the concurrency is high, and the Controller in Spring MVC cannot meet the requirements of jump. So I also tend to ask: what changes did you make to your business code other than following the existing framework?

The answer I heard was: Redis cache was added to avoid frequent calls to unchanging data. Otherwise, in MyBitas XML, the select statement where condition has ISNULL, i.e., if the value has a WHERE condition, then the query condition will be added to any WHERE without ISNULL, so that the statement will not do a full table scan when all parameters are null. Or, to put it simply, the data returned asynchronously at the back end is very large and takes a long time. I adjusted the maximum time for asynchronous return in the project, or compressed the returned information to increase the network transmission performance.

I don’t care what the answer to this question is, I only care if it is logical. If I get it right, I usually say “I have my own experience and understanding of the framework level”, otherwise, I just say “I can only write framework code under the guidance of the project manager, but I don’t know much about the framework itself”.

In fact, when preparing for an interview, it is not difficult to summarize the main points in the framework. I do not believe that everyone does not accumulate anything in the project. If you mention it, you can say that you beat nearly 70% of your competitors in this aspect.

Don’t just look at the standalone version of the framework, the appropriate understanding of some distributed

In addition, when describing framework techniques in a project, it is best to include distributed techniques. Here’s a list of distributed technologies that you can prepare for.

  1. On the reverse proxy side, nGINx basic configuration, such as how to set rules through Lua, how to set session stickiness. If you can, take a look at the underlying nGINx, such as protocols, cluster Settings, failover, etc.
  2. In terms of remote calls to Dubbo, you can take a look at the integration of Dubbo and ZooKeeper and learn more about the underlying transport protocol and serialization method of Dubbo.
  3. In terms of message queues, take a look at how Kafka or any of its components are used. In a simpler way, take a look at configuration, workgroup Settings, and in a more in-depth way, take a look at Kafka clustering, persistence, and whether messages are sent using long connections or short intercepts.

These are just three examples, you can also take a look at Redis cache, logging framework, MyCAT sub-library sub-table, etc. There are two kinds of ways to prepare, the first is to be able to say how to use, this is relatively simple, can build a function module through the configuration file, the second is to be able to read some low-level code, in order to understand the protocol, clustering and failover and other advanced knowledge.

If you can talk about the basics of distributed components in an interview, you will get a good rating, such as “deep understanding of framework basics” or “framework experience”, even if you are interviewing for an architect, let alone advanced development.

Database, don’t just know add, delete, change, check, understand performance optimization

In real projects, most programmers may only use add, delete, change and check. When we use Mybatis, this situation is more common. But if you do that in an interview, you’re probably on par with your competitors.

In this regard, you can prepare the following skills:

  1. Advanced aspects of SQL, such as group by, HAVING, left join, subquery (with in), row to column, etc.
  2. In terms of table building, you can think about whether your project is using three paradigms or anti-paradigms, and why?
  3. In particular, you can prepare ways to see improvements in SQL statements through execution plans, or other ways to improve SQL performance (such as building indexes).
  4. If you feel competent, you can also prepare some MySQL cluster, MyCAT database and table skills. Such as LVS+Keepalived MySQL load balancing, MyCAT configuration. Also, if you can, look at some of the underlying code.

Even if your performance in the first three generally, then at least also can exceed nearly normal candidates, especially when you are in the SQL optimization performance is very good, so you in the interview, a senior development, the database must be up to standard, if you even the fourth answer is very good, so congratulations you, you ability in database and even reached the level of primary structure.

Core aspects of Java, around data structure and performance optimization to prepare interview questions

In addition to the Java core, you should also focus on collections (i.e., data structures) and multi-threaded concurrency. Based on this, you can prepare some design patterns and virtual machine speech.

Here are some of the questions I usually ask:

  1. String a = “123”; String b = “123”; What is the result of a==b? This includes memory, String storage, and so on.
  2. When do the hashCode and equal methods in a HashMap need to be overridden? What happens if you don’t rewrite it? You can learn more about the underlying implementation of HashMap (and even ConcurrentHashMap).
  3. What are the differences between ArrayList and LinkedList underlying implementations? Where do they apply? You can also understand the underlying code.
  4. What does the volatile keyword do? This gives you an idea of the difference between thread memory and heap memory
  5. CompletableFuture is a new feature in JDK1.8.
  6. In the JVM, where is the object coming out of new? Dig a little deeper and ask how to view and tune JVM virtual machine memory.
  7. What is the difference between Java static and dynamic proxies? It is best to speak in terms of underlying code.

With the above question points, I’m not really at the “can use” level. For example, I’m not asking how to place elements in an ArrayList. As you can see, the above questions include “multithreading concurrency”, “JVM optimization”, “data structure object underlying code” and other details, you can also draw a conclusion from the above, by looking at some advanced knowledge, more preparation for other similar interview questions.

We know that Java development is currently based on Web frameworks, so why ask about Java core knowledge? I know this firsthand.

I have seen two people in my team before. One of them is quick at work, which shows that he can use the basic API of Java core, but has no desire to know more about it (I don’t know how to know more about it). The other one is usually specialized in reading advanced knowledge about Java concurrency and virtual machines. After half a year, the latter’s ability was quickly upgraded to advanced development. Since he had a thorough understanding of the JAVA core knowledge, it was not a big problem to see the low-level implementation of some distributed components. The former, on the other hand, have been repeatedly working, and their ability has only stayed at the “can work” level.

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

On Linux, at least know how to look at logs to troubleshoot problems

If a candidate can prove that he can “troubleshoot” and “solve problems,” that’s definitely a plus, but how?

Most of the current Internet projects are deployed on Linux, that is, logging is on Linux. Here is a summary of the actual Linux operations.

  1. Can open the file using less command, Shift+G to the bottom of the file, and then through? + keyword to search for information by keyword.
  2. Can check keyword by grep, specific usage is, grep keyword file name, if you want to find the words in the twice, just 1 file with grep keyword | keyword 2 – color. Finally –color is the highlight keyword.
  3. Can edit files through VI.
  4. File permissions can be set by chmod.

Of course, there are more useful Linux commands, but in the actual interview process, many candidates don’t know a single Linux command. Again, if you know the basics, you’re better than the average person.

Read through a piece of underlying code as a bonus

How do you prove that you know a lot about a topic? Nothing can be more illustrative than the underlying code. I’ve talked to a lot of programmers with less than 5 years of experience, and a lot of people say it’s hard, right? Sure, it’s hard to understand distributed components by reading the underlying code, but it’s not hard to understand the underlying code in the following sections.

  1. ArrayList,LinkedList, the underlying code contains arrays and LinkedList based implementations, if you can explain the expansion, “traversal through the enumerator,” and so on, absolutely prove themselves.
  2. A HashMap directly corresponds to the Hash table data structure. The underlying code of a HashMap contains hashCode put and get operations, and even a Lock logic in a ConcurrentHashMap. I believe that if you look at the ConcurrentHashMap and draw it on paper, it will win over the interviewer.
  3. Take a look at how static and dynamic proxies are implemented, and take a closer look at the implementation code in Spring AOP.
  4. The underlying implementation code for Spirng IOC and MVC may be difficult to understand, but you can talk about the key classes and how they are implemented according to the key flow.

It is not necessary to prepare much underlying code, and it is not limited to any aspect, such as TreeSet based on red black trees in collections, open source framework based on NIO, or even Dubbo for distributed components. And it doesn’t have to be memorized (which is hard to do), just a combination of important classes and methods (for example, how a HashMap can be quickly located using hashCode).

How do you find a good time to talk about the underlying code you’ve prepared? When you’re asked about collections, the Spring MVC framework, and when you say something like, “I also know the underlying implementation of this,” the interviewer will ask, and you can say it.

Don’t underestimate how helpful this is to the candidate. Once you’ve spoken, as long as the meaning is in place, you’ll get at least a “positive professional” rating. If the description is clear, then the rating will be upgraded to “Familiar with Java core skills (or Spring MVC) and solid fundamentals.” Remember, it’s rare for someone to be able to explain the underlying code in an interview, so bringing it up won’t devalue you if it doesn’t work out as expected. So preparing for this is definitely a “no harm but good” business.

All in all, embed these skills in the projects you’ve done

In the interview process, I often hear some regrettable answers. For example, the candidate talks a lot about SQL optimization skills, but it turns out that he has learned it by himself and has not used it in actual projects.

Of course, this is better than nothing, so I will write “self-taught SQL optimization skills in daily life”, but if I have practiced in the project, then I will write “actual database SQL optimization skills”. We can compare the difference between the two, one is more theoretical, one is directly able to work. In fact, in many scenarios, I do not believe that SQL optimization skills are not practiced in real projects.

What I want to take away from this example is that a lot of the skills and rhetoric that you’ve worked so hard (and didn’t take a lot of effort) to prepare should eventually be applied to your actual projects.

For example, if you’ve ever looked up a keyword in a Linux log to troubleshoot a problem, you can say, “I did this in a previous project.” If you look at the underlying code and understand the difference between TreeSet and HashSet and their scope, then you can think back to your previous projects. Is there a scenario that only applies to TreeSet? If so, then you can describe the requirements of the project appropriately and say, I understand the difference by reading the underlying code, and I used TreeSet for this actual requirement, and I did a comparative experiment and found that TreeSet is xx percentage points higher than HashSet.

Remember that “practical experience” is worth more than “theoretical experience”, and most of the theoretical experience you know will have been used in your projects. So you’re doing yourself a disservice if you give the impression that you only have “theoretical experience.”

Summary: This article covers more ways to prepare for an interview

There are not many interview questions, but this article is not intended to give too many. Here, you’ll see more of the pain points interviewers find in many candidates.

The purpose of this article is to make sure you don’t make the same mistakes as others, and there are some tips on how to prepare for an interview. Your skills may be superior, but if you approach the interview in the same way as others, or if you focus on the work you did on a project without summarizing your highlights, the interviewer will really underestimate you.

Please share the tips and skills mentioned in this article, or click the button below to “recommend this article”, or join the discussion by commenting.

This article is welcome to reprint, but please note the source of the article, please also give the link between the two books I wrote Java Web lightweight development interview tutorial and Java core technology and interview guide.

Thanks again for reading this article.

Open Source Project Recommendation

Other open source projects recommended by the authors:

  1. JavaGuide: A Java learning + Interview Guide that covers the core knowledge that most Java programmers need to master.
  2. Springboot-guide: A Spring Boot tutorial for beginners and experienced developers.
  3. Advancer-advancement: I think there are some good habits that technical people should have!
  4. Spring-security-jwt-guide: Start from Scratch! Spring Security With JWT (including permission validation) backend part of the code.

The public,