Recently, I was honored to be an interviewer for the company again, and then I interviewed several candidates for the Java backend with 3 to 5 years of experience. My criteria are not that difficult:
First, I can work, second, I have a good Java foundation, and third, I’d better be familiar with distributed frameworks. I believe other companies should follow this standard when recruiting 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. It’s not that you don’t take an interview seriously because you think you’re done. It’s your personal attitude.
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.
Before the interview, I will read the resume to see the candidate’s framework experience. During the presentation 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, know something about distributed. In addition, when describing the framework technology in your project, it is best to include distributed technology. Here’s a list of distributed technologies that you can prepare for.
1, reverse proxy aspect, nGINx basic configuration, such as how to set rules through Lua language, how to set session stickiness. If you can, take a look at the underlying nGINx, such as protocols, cluster Settings, failover, etc.
2, remote call dubbo, can see the knowledge of dubbo and ZooKeeper integration, and further understand the underlying transmission protocol and serialization mode of Dubbo.
In terms of message queues, you can take a look at how Kafka or any of its components are used. To simplify, you can take a look at configuration, workgroup Settings, and further, you can take a look at Kafka clusters, 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.
In terms of database, don’t just know add, delete, change and check, but know about performance optimization. In actual 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, SQL advanced uses, such as group by, HAVING, left join, subquery (with in), row to column, etc.
2. In terms of table building, you can consider whether you use three paradigms or anti-paradigms in your project. What are the reasons?
**3, especially optimizations, you can prepare ways to see improvements in SQL statements through execution plans, or other ways to improve SQL performance (such as building indexes, etc.) ****.
4, if you feel competent, you can also prepare some MySQL cluster, MyCAT sub-database sub-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.
Java core, around the data structure and performance optimization preparation of the interview questions, but in addition to this, you should also focus on the collection (data structure) and multithreading concurrency two pieces, 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.
When should the hashCode and equal methods in HashMap 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 is the difference 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, this is a new feature in JDK1.8, how to achieve multi-threaded concurrency control through it?
6. In the JVM, where does the new object come out? 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 has “troubleshooting” and “problem solving” skills, 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 via less command, Shift+G to the bottom of the file, then through? + keyword to search for information by keyword.
Would 2, through the way of grep to find keywords, 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, can set file permissions through 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. How can you prove that you know a topic well? 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, the ArrayList, and LinkedList underlying code, contained is implemented based on array and a linked list, if you can help clear expansion, “through the enumerator traversal”, can prove himself.
2. A HashMap directly corresponds to the Hash table data structure. The underlying code of a HashMap contains the put and get operations of HashCode, and even the Lock logic of ConcurrentHashMap. I believe that if you look at the ConcurrentHashMap and draw it on paper, it will win over the interviewer.
Take a look at the implementation of static and dynamic proxies, and take a closer look at the implementation code in Spring AOP.
4. The underlying implementation code of Spirng IOC and MVC may be difficult to understand, but you can talk about some 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.
In the interview process, I often hear some unfortunate answers, such as candidates talking about SQL optimization skills, but it turns out that they learned these skills on their own and did not use them in real 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.”
There aren’t many interview questions in this article, but it’s not intended to be 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. And, in fact, you interview many times, you can naturally absorb their shortcomings in the experience of failure, I do not mean to let you hold a fun attitude to interview, the best hope is helpful to you, so, if this article can help you count attention or collection!