preface

Work turns screws, interview builds rockets. I think this is a headache for every programmer! However, you have to go through an interview process, especially when you don’t know what the interviewer is asking, so you don’t know how to answer it. This article is 7 years of work Java programmers from dozens of interviews selected out of the interview probability of some of the topics, ensure that we have been asked (is so confident), I hope to help you find a job.

The following interview questions are just a few of the most frequently asked questions that I have compiled. In addition, I have compiled and collected a collection of interview questions from more than 20 companies, as well as various core Java knowledge points that I can share with you for free. Need friends can click here to get!

JVM interview questions

1. Partitions in the heap: Eden, Survival (from+ to), old age, and their characteristics.

A: The JVM has a heap area and a stack area, and a method area, where initialized objects are placed on the heap and references are placed on the stack.

The class information constant pool (static constants and static variables) is placed in the method area

New :① Method area: mainly store class information, constant pool (static constants and static variables), compiled code (bytecode) and other data

(2) Heap: initialized objects, member variables (non-static variables), all object instances and arrays are allocated on the heap

③ stack: stack structure is composed of stack frames, call a method to press into a frame, frame above storage local variable table, operand stack, method exit information, local variable table storage is 8 basic types plus an application type, so it is a pointer to the address

(4) Local method stack: mainly serves Native methods

⑤ program counter: record the line number executed by the current thread

2. Two determination methods of GC:

3. What is SafePoint

4. What are the principles and characteristics of GC’s three collection methods: mark clearing, mark sorting and copy algorithm? What are your thoughts on how to optimize the collection method?

When will the Minor and Full GC occur?

6. What are the partitions of JVM memory, and what is the function of each partition?

7. How to determine if an object is alive? (or GC object determination method)

2, Redis series of interview questions

What are the advantages of Redis over memcached?

2. What data types does Redis support?

3. What kinds of data elimination strategies does Redis have?

4. Why does Redis need to put all data in memory?

5. Under what circumstances will Redis cluster solution cause the whole cluster to be unavailable?

MySQL has 2000W data, redis only 20W data, how to ensure that redis data is hot data?

7. What does Redis have to do with Redisson?

Mysql series interview questions

1. What are the technical features of Mysql?

What is the usage of ENUM in Mysql?

3. What are the advantages of Mysql over Oracle?

4. What can be the string types of columns?

5. Please briefly describe the four transaction isolation levels supported by InnoDB in Mysql and the differences between them.

6, What do % and _ in LIKE declarations mean?

7. Where will MyISAM tables be stored and their storage format provided?

Netty series interview questions

1, BIO, NIO and AIO?

A: BIO: One thread for each connection. When a client has a connection request, the server needs to start a thread to process it. Threads are expensive.

Pseudo asynchronous IO: Request connections are put into a thread pool, one-to-many, but threads are still a valuable resource.

NIO: One thread per request, but all connection requests sent by the client are registered with the multiplexer, multiplexing

The server polls the connection for I/O requests before starting a thread to process them.

AIO: a valid request to a thread. The CLIENT’s I/O request is completed by the OS and then notified the server application to start the thread for processing. BIO is stream-oriented and NIO is buffer-oriented. The BIO streams are blocked. NIO is non-blocking; BIO’s Stream is one-way, while NIO’s channel is bidirectional.

NIO features: Event-driven model, single-thread processing multi-task, non-blocking I/O, I/O reads and writes no longer block, but return 0, block-based transmission is more efficient than stream-based transmission, more advanced IO functions zero-copy, IO multiplexing greatly improve the scalability and practicality of Java network applications. Based on the Reactor thread model.

In the Reactor model, the event distributor waits for an event or a state that can be applied to an action. The event distributor passes the event to a pre-registered event handler or callback that does the actual reading and writing. For example, read is implemented in Reactor: register read ready event, corresponding event handler, event distributor waits for event and event arrival, activate distributor, distributor calls handler corresponding to event to complete actual read operation, process read data, register new event, and then return control.

2, TCP sticky/unpack the reason and solution?

What serialization protocols do you know?

How to choose the serialization protocol?

5, Netty zero copy implementation?

6. In what aspects is Netty’s high performance?

Five, SQL optimization series of interview questions

1. What are the technical features of Mysql?

A: Mysql database software is a client or server system, including: multi-threaded SQL server supporting various client programs and libraries, different backends, extensive application programming interfaces and management tools.

What is a Heap table?

What is the default port of the Mysql server?

4. What are the advantages of Mysql over Oracle?

5, distinguish between CHAR_LENGTH and LENGTH?

What storage engine is used in Mysql?

Duddo

Zookeeper is the registry in Dubbo. If the registry clusters are down, can publishers and subscribers still communicate with each other?

Dubbo service load balancing policy?

3. How is Dubbo solved in terms of safety mechanism

4. The difference between dubbo connection registry and direct connection

5. Dubbo service cluster configuration (Cluster fault tolerance mode)

6. Dubbo communication protocol Why duBBO protocol has more consumers than providers:

7. Dubbo Communication protocol Application scope and scenario of duBBO

Seven, design mode series interview questions

How many design patterns are commonly used in the JDK?

A: The Singleton pattern is used in Runtime, Calendar and other classes. Factory patterns are used for various immutable classes such as Boolean. Like Boolean. ValueOf, Observer patterns are used in Swing and many event listeners. The Decoratordesign pattern is used in several Java IO classes.

2. What are design patterns? Do you use any design patterns in your code?

What is the singleton design pattern in Java? Write thread-safe singleton patterns in Java

4. What is the Observer Design Pattern in Java?

5. What are the main benefits of using the factory model? Where is it used?

6, How about a Java decorator design pattern? Does it work at the object level or the class level?

7. Give an example of a situation where an abstract class is preferred over an interface.

conclusion

In view of the above questions, I have summed up the Internet company Java programmer interview, involved in most of the interview questions (with detailed answers). Compiled into a document and PDF format of information, free to share. Including Dubbo, Redis, Netty, Zookeeper, Spring Cloud, distributed, high concurrency and other architecture technology core materials), I hope to help you review before the interview and find a desired job. At the same time, it also saves you time to learn by searching for information on the Internet. You can also follow me and there will be more dry goods to share in the future

Speaking of here, we must be ready to move it, because of the number of words in the article, complete information can not be uploaded, need information click here to obtain