Working screw , Interview to build rocket . I think this is a headache for every programmer ！ however , You have to go through an interview process , Especially when you can't figure out what the interviewer is asking , Lead to the interview did not know how to answer .
This paper is the work of 7 year Java Some of the more likely to be selected from the interview , I promise you've been asked （ Just so confident ）, I hope it can help you find a job .
The following interview questions are just a small part of my frequently asked questions , In addition, I organize and collect 20 Interview questions of many companies in 1998 , As well as a variety of Java Core knowledge points can be shared for free , The bottom part is just a part of the map .
Friends in need can click on the portal to get Java Interview questions ：https://shimo.im/docs/QyJrRJVRdpptDYgk/
One 、JVM A series of interview questions
1、 Partitions in the heap ：Eden,survival （from+ to）, Old age , Their characteristics .
answer ：JVM It is divided into heap area and stack area , And the method area , The initialized object is put in the heap , References on the stack ,
class Class information constant pool （static Constant and static Variable ） Wait in the method area
new:① Method area ： Mainly storage information , Constant pool （static Constant and static Variable ）, Compiled code （ Bytecode ） Data such as
② Pile up ： Initialized objects , Member variables （ That's not static The variable of ）, All object instances and arrays are allocated on the heap
③ Stack ： Stack structure is composed of stack frame , Call a method and press in a frame , Local variable table stored above frame , The stack of operands , Method exit information , The local variable table stores 8 Big foundation type plus an application type , So it's still an address pointer
④ Native Method Stack ： Mainly for Native Method service
⑤ Program counter ： Record the line number of current thread execution
2、GC Two judgment methods of ：
3、SafePoint What is it?
4、GC Three collection methods of ： Mark clear 、 Tag to sort out 、 Principle and characteristics of replication algorithm , Where to use them separately , If you want to optimize the collection method , What's the idea ？
5、Minor GC And Full GC When do they happen ？
6、JVM What are the areas of memory , What is the role of each zone ?
7、 How to judge whether an object is alive ?( perhaps GC The method of judging objects )
Two 、Redis A series of interview questions
1、Redis And memcached What are the advantages over ？
2、Redis Which data types are supported ？
3、Redis What are the data elimination strategies ？
4、 Why? Redis You need to put all the data in memory ？
5、Redis When will the cluster scheme cause the whole cluster to be unavailable ？
6、MySQL Are there in 2000w data ,redis The only known 20w The data of , How to ensure redis The data in is hot data ？
7、Redis and Redisson What does it matter ？
3、 ... and 、 Mysql A series of interview questions
1、Mysql What are the technical characteristics of ？
2、 stay Mysql in ENUM What is the usage of ？
3、 And Oracle comparison ,Mysql What are the advantages ？
4、 What string types of columns can be ？
5、 Please briefly describe Mysql in InnoDB Four supported transaction isolation level names , And the difference between levels ？
6、LIKE Statement ％ and _ What does that mean? ？
7、MyISAM Where will the forms be stored , And also provides its storage format ？
Four 、Netty A series of interview questions
1、BIO、NIO and AIO The difference between ？
answer ：BIO： One connection, one thread , When the client has a connection request, the server will Need to start a thread to process . High thread overhead .
Pseudo asynchrony IO： Put the request connection into the thread pool , One to many , But threads are still a valuable resource .
NIO： One request, one thread , But the connection requests sent by the client are registered on the multiplexer , Multiplexing
The connection to the poller is I/O Start a thread to process when requested .
AIO： A valid request, a thread , Client's I/O All requests were made by OS First complete and then inform the server application to start the thread for processing ,BIO It's stream oriented ,NIO It's buffer oriented ;BIO The various streams of are blocked . and NIO It's non blocking ;BIO Of Stream Is one-way , and NIO Of channel It's two-way .
NIO Characteristics ： Event driven model 、 Single thread processing multitasking 、 Non blocking I/O,I/O Reading and writing are no longer blocked , It's going back to 0、 be based on block Is more efficient than stream based transmission 、 More advanced IO function zero-copy、IO Multiplexing greatly improves Java Scalability and practicality of network applications . be based on Reactor Threading model .
stay Reactor In the pattern , The event distributor waits for an event or the state of an application or operation to occur , The event distributor will pass this event to the pre registered event handler or callback function , The latter does the actual reading and writing operations . If in Reactor To realize reading in ： Register the read ready event and the corresponding event handler 、 The event distributor waits for events 、 The event came , Activate distributor , The dispatcher calls the handler corresponding to the event 、 The event handler completes the actual read operation , Processing read data , Register new events , And then return control .
2、TCP Sticky package / The reason and solution of unpacking ？
3、 Know which serialization protocols ？
4、 How to choose serialization protocol ？
5、Netty Zero copy implementation of ？
6、.Netty What is the performance of the high performance of ？
5、 ... and 、SQL Optimize a series of interview questions
1、Mysql What are the technical characteristics of ？
answer ：Mysql Database software is a client or server system , These include ： Supports multithreading of various client programs and libraries SQL The server 、 Different back ends 、 A wide range of application programming interfaces and management tools .
2、Heap What is a watch ？
3、Mysql What is the default port of the server ？
4、 And Oracle comparison ,Mysql What are the advantages ？
5、 distinguish CHAR_LENGTH and LENGTH？
6、Mysql What storage engine is used in ？
6、 ... and 、Duddo A series of interview questions
1、Dubbo in zookeeper Be a registry , If all the registry clusters hang up , Can publishers and subscribers still communicate ？
2、dubbo Service load balancing strategy ？
3、Dubbo How to solve this problem in terms of security mechanism
4、dubbo The difference between connecting a registry and a direct connection
5、dubbo Service cluster configuration （ Cluster fault tolerant mode ）
6、dubbo Communication protocol dubbo Why do agreements require more consumers than providers ：
7、dubbo Communication protocol dubbo Scope and scenario of application of the agreement
7、 ... and 、 Design pattern series interview questions
1、 Please list in JDK Several common design patterns in ？
answer ： The singleton pattern （Singleton pattern） be used for Runtime,Calendar And some other classes . Factory mode （Factory pattern） Used for various immutable classes such as Boolean, image Boolean.valueOf, Observer mode （Observer pattern） Be used for Swing And a lot of event monitoring . Decorator design pattern （Decoratordesign pattern） Used for more than one Java IO Class .
2、 What is design pattern ？ Have you ever used any design patterns in your code ？
3、Java What is singleton design pattern in ？ Please use Java Write a thread safe singleton pattern
4、 stay Java in , What is observer design pattern （observer design pattern）？
5、 What are the main benefits of using the factory model ？ Where to use ？
6、 Let's take one Java Realized decoration mode (decorator design pattern)？ Does it work at the object level or the class level ？
7、 Give examples of situations where abstract classes are more likely to be used than interfaces ？
For the above interview questions , I summed up the Internet companies Java In the programmer interview , Most of the interview questions involved （ A detailed explanation of the answer is attached ）. It's documented and PDF Format information , Free to share . Include Dubbo、Redis、Netty、Zookeeper、Spring Cloud、 Distributed 、 High concurrency and other architecture technology point core data ）, Hope to help you review before the interview and find a job you like . meanwhile , It also saves you the time to study by searching for information online , You can also pay attention to me, and there will be more dry goods to share in the future ~
Speaking of this , Everyone must be ready to move , Because of the number of words in the article , You can't upload all the information , Friends who need information can click on the portal to get Java Interview questions ：https://shimo.im/docs/QyJrRJVRdpptDYgk/