Years ago, I had an unexpected telephone interview with ALI , I didn't want to change my job , But this amateur HR( It should be the technical director ) They didn't explain their jobs and requirements , Directly agree on a certain night's electricity time , With a curious attitude “ Abuse ” One .

Generally speaking, the interviewer asked a very deep question , It's basically system or principle level . I don't know if it represents the basic idea of Ali's interview .

JVM Memory model of

Memory space (Runtime Data Area) Can be divided into two parts according to whether the thread is shared or not , Threads share method areas (Method
Area) Heaps (Heap), The thread is exclusive Java Stack (Java Stack), Native Method Stack (Native Method Stack) and PC register (Program
Counter Register).

Of course 1.8 There are some changes , According to my understanding , The original constant pool and other information are stored in the method area , Now it's all in the pile .

1.8 in -XX:PermSize and -XX:MaxPermSize It is invalid , Instead, it's a new area —— Metaspace( metadata area ).

stay JDK 1.7 And the past JDK In version ,Java Class information , Constant pool , Static variables are stored in the Perm( Permanent generation ) in . Class metadata and static variables are assigned to the
Perm, When a class is unloaded, the garbage collector Perm Remove the metadata and static variables of the class . Of course, the constant pool will also be in the Perm Dispose of the garbage when it is collected .

JDK 1.8 Yes JVM The transformation of the architecture puts the class metadata into local memory , in addition , Put the constant pool and static variables into the Java In the pile .HotSopt VM
Local memory is explicitly allocated and freed for class metadata . In this framework , Class meta information breaks through the original -XX:MaxPermSize
The limitation of , More local memory can now be used . In this way, to a certain extent, it solves the problem that a large number of classes are generated at runtime Full GC problem , If you use reflection at runtime , Agency, etc .

So after upgrading Java Heap space may increase .

http1.0,http1.1,http2.0 difference

To be honest, I didn't touch it 1.0, I only know how to follow 1.0 comparison 1.1 You can transfer multiple files at a time , All kinds of browsers probably support it 3~5 Requests sent at the same time .

http2.0 It's also the latest Nginx Just know something , The main thing is that the binary format replaces the original text . After checking the information, we know that multiplexing and head compression are added head of
line blocking, There are also server pushing Etc . The agreement still needs to see the explanation on the official website , But it's easy to forget after a while .

Get/Post Impact on cache

I haven't had this question all the time Get Arrive at the point , The intention is to ask the browser cache for HTTP Method in Get and Post Is the request supported , The answer is No Post
Method.Get Can be cached by the browser .

Browser rendering mechanism

I can't answer this question , It's too big a question , Maybe I did V8 Some of the mechanisms of . For example, build Dom, generate CSS Rule wait . But the reality has not been systematically understood .

mysql Of Join Principle and index data structure and implementation principle

Only know mysql innoDB join Support only Nested Loop, I won't support it Hash
Join, Is to determine a driver table after the continuous Join Get the result set , Go on Join. therefore Join The order is important .

The index only knows that the data structure is B+Tree, In fact, it's really sad . So review it , I found a good article
<https://link.juejin.im/?target=http%3A%2F%2Fblog.codinglabs.org%2Farticles%2Ftheory-of-mysql-index.html>
.

browser meta charset and response in content-type Priority of

This question is also confused , In fact, we should recall this sentence ,
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Abbreviation is
<meta charset="utf-8" />
http-equiv This property is the corresponding HTTP response headers Projects inside , Its original intention is to make it impossible ( For example, there is no authority ) Setting up the server header
It can be used to inform the browser about the content of some pages .

As you can see from the above, the latter must have a higher priority .


To sum up , Maimed naked face , Ali's interviewers are definitely technical , The principle of asking questions when one word doesn't agree , Touch the soul . Reflect on yourself or use too much , The protocol, the operating system, or forget quickly , There is no systematic understanding . In the future, we should learn more from the old .

Java Advanced architecture (②~)702895903