1. Introduce yourself. , briefly tell us about your project?
2. Have you ever encountered a memory leak? How did you solve it? I did encounter this once a while ago, and I was pretty lucky.
3. What are the basic types of java? Is String a basic type of Java? Why does String have to be of final type?
4. What is the underlying implementation of the reflection mechanism? What about dynamics? Dynamic implementation principle?
5. Do you understandHashMap
? Tell me something related toHashMap
? IsHashMap
thread-safe? Why is it thread safe?ConcureentHashMap
Do you understand? How does he achieve thread safety? Did you just say that 1.8 is based onCAS
? How to solve the ABA problem ofCAS
?
6. Tell me about the threading model of JVM? What are these areas used for?Java
Threading model andJVM
Threading model Pay attention to the distinction and summary. Many articles on the Internet are wrong.
7. Tell me about the working mechanism of java class loader? In which area is class loading performed?
8. Let’s talk about Java’s thread model? Do you understand violation? What is his rationale? Is violate thread safe? Why not?
9. What are the solutions to ensure thread safety? Let’s talk about read-write locks. What are the read-write locks? 10. What types of database indexes are there? Why use B-tree for indexing? What is the difference between a combined index and several individual indexes? Do you understand the optimization of large table queries in databases?
MVCCDo you understand the mechanism? What's wrong with the MVCC mechanism? How to solve this problem?MySQLmysql
Have you done any slow statement tuning? Tell me how you did it?11. Do you understand
? Can you tell me how to useRedis
to implement distributed locks?12. Is the scope of the Bean in
and thecontroller
ofSpring MVC
thread-safe? How to ensure thread safety?(The interview comes from a netizen: two years of work experience, Shanruyar)
After reading the above questions, how well do you think you can answer them? According to the100
score system, how many points would you give yourself?
1. Please introduce yourself and briefly talk about your project?
Two questions, one is to introduce yourself, and the other is to introduce the project. The project introduction is the one you are most familiar with or the one you can best use, which may not necessarily be the project you are working on recently.
2. Have you ever encountered a memory leak? How did you solve it? I did encounter this once a while ago, and I was pretty lucky.
This problem is based on daily summary. If you have never encountered it before, you can simulate it yourself, and then use various commands and tools to troubleshoot. When asked during the interview, just briefly talk about the troubleshooting ideas and the commands and tools used in the troubleshooting process.
3. What are the basic types of Java? Is String a basic type in Java? Why does String have to be of final type?
The first two questions are based on the investigation. The third question requires you to reflect on your own. Why should it be set to a final type? You have to think about what characteristics the final modification class has? What role does it play here?
4. What is the underlying implementation of the reflection mechanism? What about dynamics? Dynamic implementation principle?
This can also be regarded as an examination of whether the basic knowledge is solid, focusing on dynamics and the relationship between dynamics and reflection.
5. Do you understandHashMap
? Tell me something related toHashMap
? Is HashMap thread-safe? Why is it thread safe?ConcurrentHashMap
Do you understand? How does he achieve thread safety? Did you just say that 1.8 is based on CAS? How to solve the ABA problem of CAS?
These are a few questions,
HashMap
You have to tell me what HashMap is, What data structure is used to implement the bottom layer? It’s best to tell me about the put process What is it like in each version of the JDK version? Why is HashMap thread-unsafe?
ConcurrentHashMap
Question
ConcurrentHashMap
What is it?ConcurrentHashMap
What is the underlying data structure?JDK
Different versions, what are the differences in design ofConcurrentHashMap
CAS
Question
What is CAS
?CAS
What is the problemABA
What is the problemABA
How to solve the problemDon't even think about reading this question, many people are hung up on this question. Memorize the interview questions and have a little bit of understanding, and you can handle these problems.
6. Tell me about the threading model of JVM? What are these areas used for? Pay attention to the distinction between the java thread model and the jvm thread model. To summarize, many articles on the Internet are wrong.
What we examine is the JVM memory model, and usually also the JVM runtime data area. Note that you must not bring in the Java memory model here. The Java memory model is called JMM.
When it comes to the JVM runtime data area, thread private and thread sharing will be mentioned.
Especially the Java virtual machine stack, heap, and method area. These three must be explained clearly.
What is the relationship between stack and thread? What is stored in the stack? Why SOF?
The heap is related to object memory allocation, so we will definitely talk about the life cycle of the object. Thenwilltalk about how classes are loaded into the JVM?How to determine if an object is dead?We will also talk about what are the garbage collection algorithms?What are the garbage collectors?What is the latest garbage collector?What are the features?
What JVM tuning parameters are you familiar with?
A lot of people will fail this question. I have also conducted online mock interviews with many people. When it comes to JVM, 90% of them will fail.
7. Tell me about the working mechanism of theJava
class loader? In which area is class loading performed?
As mentioned in the above question, this class loading related question will definitely ask, indicating that you know how a class goes from the
.class
file to theClass object
, then go to the actualexample
process to see how familiar you areThese questions can also be fed back from the side, how do you run each line of your code, and what problems will there be? Know something.
8. Let’s talk about Java’s threading model? Do you understand volatile? What is his rationale? Is violate thread safe? Why not?
You need to be familiar with the Java thread model, and you also need to understand volatile. What are its characteristics, such as visibility, anti-rearrangement, and atomicity. You also need to understand these.
This question is relatively theoretical, and you can basically solve it by memorizing the interview questions.
9. What are the solutions to ensure thread safety? Let’s talk about read-write locks. The read
of read-write locks are all theoretical. You can solve them by memorizing the interview questions. You don’t have to have used them before. Just go down and prepare yourself
10. What kinds of indexes are there in the database? Why use B-tree for indexing? What is the difference between a combined index and several individual indexes? Do you understand the optimization of large table queries in databases?MVCC
Do you understand the mechanism?MVCC
What’s wrong with the mechanism? How to solve this problem?MySQL
Have you done any slow statement tuning? Tell me how you did it?
This is equivalent to 8 consecutive questions of the
MySQL
database. How many of the 8 consecutive questions can you answer? Basically, I usually read more interview experience and memorize the interview questions to cope with it.
11. Do you understandRedis
? Can you tell me how to useRedis
to implement distributed locks?
This question actually seems simple, but the answer is not that simple.
There are many social things here, not just a simple
setnx
,LUA script
can be solved, involvingRedis
cluster mode, involving business timeout and other issues. The interviewer has arranged it for you. This requires some real materials. Memorizing the interview questions can only cope with the more superficial interviewers. If you meet the more serious interviewer, you have to use your own real materials to answer the questions. .
12. The scope ofBean
inSpring
and thecontroller
ofSpring MVC
are thread-safe. ? How to ensure thread safety?
There is notoabout this question, because major public accounts and my public account have posted similar articles before, so I have time. Don’t underestimate the importance of public accounts.It’s just about accumulation. When you are resting in the car, on the subway, or at your work station, you can use some trivial time to read some technical official articles and accumulate your own knowledge.
To be honest, we can pass 90% of the above questions Memorize the interview questions to solve. There may be some questions that you need to really experience before you can solve them.
But I always believe that:With less than five years of work experience, interviews can basically be solved by memorizing interview questions.
The above is the detailed content of Meituan, see if you can answer it?. For more information, please follow other related articles on the PHP Chinese website!