Summary of Java Advanced Interview Questions and Answer Analysis of First-line Internet Companies

1. Is the hashcode equal two classes must be equal? ​​What about equals? The opposite?

2. What about the collection framework?

3. What is the difference between the underlying implementation of hashmap hastable? What about hashtable and concurrenthashtable?

4. What is the difference between hashmap and treemap? What is the low-level data structure?

5. Are there any parameters used in the thread pool? How is the bottom layer implemented?

6. What is the difference between sychnized and Lock? When is sychnize an object lock? When is a global lock and why?

7. What is ThreadLocal and how to implement it? Write an example?

8. How does volitile work?

9. Does cas know how to achieve it?

10. Please write a singleton pattern in at least four ways

JVM

1. Please introduce the JVM memory model?? What garbage collectors have been used to talk about chanting

2. How to deal with the frequent full gc sending online? What should I do if the CPU usage is too high?

How to locate the problem? How to solve the problem and how to solve it

3. Do you know the bytecode? What are the bytecodes? Integer x = 5, int y = 5, what steps do you go through when comparing x = y?

4. Tell me about the class loading mechanism, which class loaders are there, and which files are loaded by these class loaders?

Write the class loading Demo by hand

5. Do you know osgi? How did he achieve it???

6. What JVM optimizations have you done? What method did you use to achieve what effect???

7. What is the difference between classforName("java.lang.String") and String classgetClassLoader() LoadClass("java.lang.String")?

Spring

1. What are the mechanisms of spring? How is the underlying AOP implemented? IOC?

2. Does cgLib know? What is the difference between it and jdk dynamic agent? Handwriting a jdk dynamic agent?

database

1. What are the principles of using mysq1 index? What data structure is indexed? What is the difference between 3+tree and B tree?

2. What storage engines does mysq1 have? What are the differences? To be detailed!

3. How to design the database level of a high-concurrency system? What types of database locks are there? How to achieve it?

4. What are the database transactions?

Sub-library and sub-table

1. How to design a sub-database and sub-table solution that can dynamically expand and shrink?

2. Which database and table middleware have you used, and what are the advantages and disadvantages? Tell me about the underlying implementation principle of the database and table middleware that you know?

3. I currently have a system that has no database and tables. In the future, the system needs to be divided into tables and tables. How to design so that the system that has not been divided into libraries and tables will be dynamically switched to the system of divided tables and tables??? TCC? What should I do if the network cannot be connected because of the network????

4. Do you know about distributed transactions? How did you solve it?

5. Why do we need to sub-database and sub-table???

6. What algorithms do distributed addressing methods know about consistent hashing? Write the java implementation code by hand?? If you get the userId and touch the shards, what should I do if I want to check the data in a continuous period of time???

7. How to solve the problem of primary key of sub-database and sub-table? What is the implementation plan?

Distributed cache

1. What is the difference between redis and memcheched? Why is single-threaded redis more efficient than multi-threaded memched?

2. What data types are redis used in which scenarios?

3. How is the master-slave replication of reids implemented? How is the cluster mode of redis implemented? How is the key of redis addressed?

4. How to design distributed locks using redis? Is it possible to use zk? How to achieve which of the two is more efficient?

5. Do you know the shortcomings and advantages of redis persistence? What about the specific underlying implementation?

6. What are the LRUs for the redis expiration strategy? Write the java version of the code?

Distributed Service Framework

1. Tell me about the implementation process of dubbo, can the registration center continue to communicate if it hangs up?

2. Do you know the principle of zk? Do you know what the Paxos algorithm can do with zk? Tell me about the principle and implementation?

3. Which serialization protocols does dubbo support? Hessian Tell me about Hessian's data structure PB, do you know why PB is the most efficient?

4. Do you know netty? What can netty do? What are NIO, BIO, and AIO, what is the difference?

5. What are the dubbo replication balance strategy and high availability strategy? What are the dynamic proxy strategies?

6. Why do we need to split the system? Is it possible to split without dubbo? What is the difference between dubbo and thrift?

Distributed message queue

1. Why use message queues? What are the advantages and disadvantages of message queues?

2. How to ensure the high availability of the message queue How to ensure that messages are not repeatedly consumed

3. What are the advantages and disadvantages of kafka, activemq, rabbitmq and rocketmq???

4. If you are asked to write a message queue, how to design the architecture? Tell me about your ideas

Distributed search engine

1. How is the working process of es realized? How to realize distributed

2. How can es improve query efficiency when the amount of data is large (billions of levels)?

3. What is the working process of es query? The underlying lucence introduces the inverted index, do you know? What is the difference between es and mongdb in what scenarios?

High concurrency and high availability architecture design

1. How to design a high concurrency and high availability system

2. How to limit the current? How to do in the project, talk about the specific implementation

3. How to use the cache What are the consequences of improper use of the cache?

4. How to fuse? What are the fuse frameworks? Do you know the specific implementation principle?

5. How to downgrade, how to split the system, how to split the database????

letter of agreement

1. Tell me about TCP'IP four layers?

2. What is the working process of http?? http1.0 http1.1http2.0 what are the specific differences?

3. The working process of TCP three-way handshake and four-layer breakup. Draw the flow chart. Why not four times, five times or two times?

4. Draw the workflow of https? How to implement it? How to prevent packet capture?

algorithm

1. It is relatively simple. I have a file with 4.5 billion Arabic numerals. How do I remove duplicates and find the largest number?

data structure

1. Binary trees and red-black trees, etc.

Classic design ideas and common design patterns used in the source code

Follow me and get it for free! Interview questions and answers

Summary of Java Advanced Interview Questions and Answer Analysis for First-line Internet Companies in 2019

Suitable for all JAVA engineers to learn

Summary of Java Advanced Interview Questions and Answer Analysis for First-line Internet Companies in 2019

Part of the interview answer

Guess you like

Origin blog.csdn.net/m0_46995061/article/details/114392579
Recommended