Directory:

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

  2. Don’t just look at the standalone version of the framework, distributed also need to understand

  3. For databases, don’t just know how to add, delete, change, check, but know how to optimize performance

  4. Java core, around data structure and performance optimization to prepare interview questions

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

  6. Read through a piece of underlying code as a bonus

  7. Be sure to incorporate these skills into your projects

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


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:

  • Number one can work

  • Second, the Java foundation is good

  • Third, be familiar with distributed frameworks

Believe that other companies recruit primary development, should also follow this standard to the surface.

I also know that many candidates are not poor in ability, but are not prepared or unable to speak up during the interview. Such people may indeed meet expectations after working in the team, but may not pass the interview, and the interviewer will only judge the interview.

You know, we’re more business oriented, and we don’t have a lot of access to algorithms, data structures, underlying code, and other interview question points.

In other words, the interview preparation points are not a good match for the main points of the job.


As the interviewer, I can only decide the interview result according to the candidate’s answer. However, with the convenience of their own convenience.

So in this article, I will introduce you to interview preparation techniques through some common questions.

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.

1.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 answers I heard were:

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 of 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. Generally, as long as the answer is correct, I will give the interview evaluation that I have my own experience in the framework level and have a certain understanding.

Otherwise, I would just say “only write framework code under the guidance of a project manager and not 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.

2, don’t just look at the stand-alone version of the framework, distributed to understand

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 broad categories of preparation:

  • The first is to be able to say how to use, this is relatively simple, can build a function module through the configuration file

  • Second, you can read some low-level code appropriately to understand the protocol, clustering and failover and other advanced knowledge points.

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.


3, for the database, do not only know to add, delete, change and check, have to 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 you are average in the first three points, you can beat nearly half of the candidates, especially if you are very good at SQL optimization, you must be qualified at the database level when interviewing for advanced development.

If you answered number four very well, then congratulations, you are even at the basic architecture level with databases.

4, Java core, around data structure and performance optimization preparation interview questions

There are a lot of questions on the Java core, but you should also focus on collections (that is, data structures) and multithreaded concurrency

On this basis, you can prepare some design patterns and virtual machine rhetoric.

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.

5. 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.

6. 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. If you’re in an interview, take a look at a ConcurrentHashMap, and then draw it on paper, it’s a surefire way to charm 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 right, you’ll get at least a “positive professional” rating. If the description is clear, 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.

7. Be sure to incorporate these skills into your projects

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.”

For example, if you’ve seen the difference between TreeSet and HashSet and their scope by looking at the underlying code, 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.”

8. 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, so here 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.

End

Author: hsm_computer

Source: https://www.cnblogs.com/JavaArchitect/p/10011253.html

The copyright of this article belongs to the author



Long press the qr code below to pay immediate attention to [Tanuki technology Nest]

Top technical experts from Alibaba, JD.com, Meituan and Bytedance are in charge

Create a “temperature” technology nest for IT people!