Summary of Java advanced interview questions for first-line Internet companies in 2018

1. The hashcodes are equal. Are the two classes necessarily equal? ​​What about equals? On the contrary?

2. Introduce the collection framework?

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

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

5. Are there any parameters for 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 the bottom layer of ThreadLocal and how to implement it? Write an example?

8. How does volatile work?

9. Does cas know how to implement it?

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

JVM

1. Please introduce the JVM memory model? What garbage collectors have you used?

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

How to locate the problem? How to solve it, talk about the solution ideas and processing methods

3. Do you know the bytecode? What are the bytecodes? Integer x = 5, int y = 5, what are the steps to compare x = y?

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

Write a class loading Demo by hand

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

6. What JVM optimizations have you done? What methods have you used to achieve what results?

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

JVM

Spring

1. What mechanisms does spring have? How does the bottom layer of AOP implement IOC?

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

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 implement it?

4. What are database transactions?

Sub-library and sub-table

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

2. Which sub-database and sub-table middleware have you used? What are the advantages and disadvantages? Tell me about the underlying implementation principle of the sub-database and sub-table middleware you know?

3. I now have a system that is not divided into databases and tables. In the future, the system needs to be divided into databases and tables. How to design, so that the system that is not divided into databases and tables can be dynamically switched to the system with sub-databases and tables? TCC? What should I do if the network fails to connect?

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

5. Why do you need to divide the database and the table?

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

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

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 used in redis 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 implement it? Which of the two is more efficient??

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

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

Distributed Service Framework

1. Tell me about the implementation process of dubbo. Can the registration center continue to communicate?

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 the data structure PB of hessian. 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 balancing strategies and high availability strategies? What about dynamic proxy strategies?

6. Why do we need to split the system? Can we 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 should you design the architecture? Tell me about your ideas

Distributed Search Engine

1. What is the working process of es? How to achieve distributed

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

3. What is the working process of es query? Let me introduce the underlying lucence, do you know the inverted index? What is the difference between es and mongdb? In what scenarios are they used?

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 it 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????

Distributed thematic architecture

letter of agreement

1. Talk about the four layers of TCP 'IP?

2. What are the differences between http1.0 http1.1http2.0?

3. TCP three-way handshake, four-layer break-up workflow

4. Draw the workflow of https? How to implement it? How to prevent the packet from being captured??

algorithm

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

data structure

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

Classic design ideas and common design patterns used in source code

Welfare

Here is a platform for everyone to learn and communicate, Java architect group: 685167672

Those with 1-5 work experience, who do not know where to start in the face of the current popular technology, and who need to break through the technical bottleneck can join the group.

After staying in the company for a long time, I lived very comfortably, but the interview hit a wall when I changed jobs. Those who need to study in a short period of time and change jobs to get high salaries can join the group.

If you have no work experience, but have a solid foundation, you can join the group if you are proficient in the working mechanism of java, common design ideas, and common java development frameworks.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325519670&siteId=291194637