One yuan resumes, and all phenomena are renewed. The Spring Festival is over, and everything is a new beginning. The "Golden Three Silver Four" is coming soon. Engineers who have plans to change jobs must have already started working hard! Today, Duidui helped you sort out some classic or tricky interview questions, as well as some difficult analysis. I hope to help you check and fill in the gaps and get your favorite offer~
1. interviewer asked me: What is request merging under high concurrency?
Author: why technology
Some time ago, a friend who was in Shenzhen and had two years of experience went out for an interview. While harvesting offers from several major manufacturers, he also summarized the interview questions encountered during the interview process. There are many interview questions. I will share it with you from time to time.
This article mainly shares a scene question he encountered during the interview process:
He said that for this scene question, there was no idea during the interview.
Seriously, request merging I know that high concurrency is nothing more than fast request merging.
However, in my limited knowledge, if it is similar to the scenario of high concurrency deduction of inventory in spikes, I personally feel that it is a bit strange and unconventional.
In the traditional, or commonly used seckill solutions in the industry, from the front-end to the back-end, you can't find the words requesting merge.
I understand that the more applicable scenarios for request consolidation are query-type, or the demand for value-increasing types. For inventory deduction, if you are not careful, there will be an oversold situation.
Of course, it is also possible that I misunderstood the meaning of the question. When I saw the high concurrency deduction of inventory, I thought of the spike scene.
But it doesn't matter, and we can't directly confront the interviewer.
I will give a scene that I think is reasonable again, and tell everyone what I understand about request merging and request merging under high concurrency.
2. Interviewer: Can you tell me what the time wheel is?
Author: why technology
Hello, I am crooked.
Today I will take you to roll the time wheel. This thing is actually quite practical.
It is common in various frameworks, and occasionally appears in the interview process. It is a little difficult to understand, but after knowing the principle, I feel:
When most people talk about time wheels, they start with netty.
I am different. I want to start from Dubbo. After all, the first time I came into contact with the time wheel was actually in Dubbo, and I was amazed at the time.
Moreover, Dubbo's time wheel is also taken from Netty's source code, which is basically the same.
3. Interviewer: Tell me about the locks in the thread pool.
Author: why technology
Recently, a reader told me that when the interview was about thread pools, they had a great conversation and basically answered all of them, but one of the questions directly drove him into a daze.
The interviewer asked him: Tell me about the locks in the thread pool.
As a result, his knowledge about the thread pool was actually seen in various blogs or facebooks. He didn't read the source code himself, so he didn't pay attention to the existence of locks in the thread pool.
He also complained to me:
When he said this, I also felt that when everyone talked about the thread pool, they didn't talk much about the locks used in it.
It is indeed very low presence.
Shall I arrange it?
4. "I want to enter a big factory", the mysql killing series 13 questions
Author: Ai Xiaoxian
1. Can you tell me the difference between myisam and innodb?
2. What are the indexes of mysql, and what are clustered and non-clustered indexes?
3. Do you know what is a covering index and a return table?
4. What are the types of locks?
5. Can you describe the basic characteristics and isolation level of transactions?
6.……
5. "I Want to Enter a Big Factory" Redis Killing Serial 11 Questions
Author: Ai Xiaoxian
1. What are the basic data types of Redis?
2. Why is Redis fast?
3. Then why did Redis 6.0 switch to multi-threading?
4. Do you know what a hot key is? How to solve the hot key problem?
5. What is cache breakdown, cache penetration, and cache avalanche?
6.……
6. JVM classic interview 20 questions
Author: Programmer Dabin
Talk about the memory structure of the JVM?
Tell me about the difference between stacks?
When does stack overflow occur?
class file structure
What is class loading? class loading process?
……
7. Interviewer: Why can't cglib delegate private methods?
Author: Look at the code and then go to work
Have you ever used Spring? Ever heard of Spring AOP? Surely there are! Today, I will talk about the principle of cglib, a proxy method in Spring AOP, and answer why cglib cannot proxy private methods by the way.
8. Java Multithreading Knowledge Cheat Sheet (1)
Author: Zhu Xiaosi
This article mainly organizes the relevant knowledge points of Java multithreading encountered by the author, which is suitable for shorthand, so it is named "Cheat Sheet". There is no special focus in this article. Each item makes a brief summary of a multi-threaded knowledge, and some will bring some examples. The exercises are easy to understand and remember.
9. It is said that 99.99% of people will answer the wrong class loading question
Author: you are stupid
First of all, I would like to throw the question to you. This problem is also a problem that our classmates encountered when they were making a performance analysis product.
Can the same class loader object load the same class file multiple times and get multiple Class objects that can all be used by the java layer?
Please pay careful attention to a few key words in the description above
The same class loader: It means that a class loader object is not new every time. I know that some students who have a little understanding of class loader will definitely think of this. What we emphasize here is the same class loader object to load.
The same class file: It means that the information in the class file is consistent, there is no modification, at least the name cannot be changed. Because some students will take advantage of the loopholes, such as getting the class file and changing the name, haha.
Multiple Class objects: It means that each creation is a new Class object, not returning the same Class object.
All can be used by the java layer: it means that the Java layer can perceive it. Maybe students who have been following my official account for a long time have read some of my articles and know what I'm talking about here. If you don't know, you can look through my previous articles. , I'll sell it here, I won't tell you which article directly, but a little hint about memory GC.
Then before reading the following article, I think you can think about a question first,
Whether the same class loader object can load the same class file multiple times and get multiple different Class objects (single choice)
A. I don't know B. Yes C. No
Although there are some headlines, I think 99.99% in the title should not be an exaggeration. This ratio may be larger, but please answer carefully, don't choose casually, I know someone will choose casually, haha.
10. How does the Java layer call the native method to find the corresponding method in the native library?
Author: RednaxelaFX
Q: If a native method is called on Java code, such as calling the getClass() native method of an object, then the following method in the native library is found from the beginning of the call at the java level?
JNIEXPORT jclass JNICALL
Java_java_lang_Object_getClass(JNIEnv *env, jobject this)
{
if (this == NULL) {
JNU_ThrowNullPointerException(env, NULL);
return 0;
} else {
return (*env)->GetObjectClass(env, this);
}
}
What happened during this period? How to find this native method, where is the relevant vm code?
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。