2020Java interview module summary

Design patterns

1. What design patterns are used? How to use the

2. Different writing methods of singleton mode

JDK

1. Talk about Java collection classes

2. The underlying data structure of HashMap and the method of resolving hash collisions

3. Why do HashMaps use red-black trees

How do collection classes solve the problem of high concurrency

5. Queue usage issues

6. Application scenarios of custom exceptions

7. Methods in the Object class

New features in 1.8

9. Static methods in Java have only one instance. What if you want to use multiple instances?

Basic features of Java object-oriented, inheritance, encapsulation and polymorphism

11. What do I mean by override and overload

How to declare that a class will not be inherited

HashMap jdk1.7 vs. JDK1.8

14. How does concurrenthashMap implement thread safety?

Is Java increment thread-safe? How to implement thread-safe increment

Where does the stream pool come from

Is Jdk1.8 completableFuture useful?

18. Java types of proxies can be implemented in several ways

JVM

1. The JVM memory model and the contents of these Spaces

2, heap memory partition space, how to recycle these memory objects, what is the recycling algorithm

3. How to solve the on-line GC problem in JVM tuning

Class initialization process

5. The cause of memory overflow and how to troubleshoot online problems

What garbage collectors does the JVM have?

Class loading model

8. Why does the JVM add meta-space?

Do you know about heap G1 garbage collector? What are its features

multithreading

1. How do threads communicate with each other

Synchronized low-level implementation, and the difference between lock

3, synchronized keyword added in static methods and instance methods

4. Use of countdownlatch

5. Thread pools

Executor provides several thread pools

(2) Thread pool parameters

(3) Rejection strategy

(4) Sequential process of task placement

(5) Whether the thread will be recycled after the task is finished

(6) Where are the threads in the unused thread pool

(7) Thread pool where threads exist

(8) Whether the cache thread pool destroys the core thread

6, Java multithreading several states and threads between each state is how to switch

Wait and sleep in Java

8. How to pass data in the method stack?

What are the underlying implementation forms and data structures of ThreadLocal?

10. Sychornized is a fair lock

The difference between Sychronized and ReentryLock

Number of server cpus and number of thread pools

mysql

1, Mysql index type, underlying index data structure, what is stored in leaf nodes, the cause of index failure

2, how to optimize SQL, query plan results to see some key data

3. Differences between InnoDB and MyISam

Mysql default isolation level

Mysql optimistic lock and pessimistic lock

6, how to use SQL to implement optimistic lock and pessimistic lock

Mysql > select * from database

8, why MySQL choose B+ tree as its storage structure, why not Hash, binary, red and black tree

Mysql database transaction and lock understanding

10, database temporary table has not used, is how to use?

11. How to manage things in the case of multiple data sources

What is the difference between a Union and a Union all

13, What is the difference between dateTime and timestamp

Mysql master-slave mode implementation

How to parse SQL statements; The use of the explain keyword

Mysql master-slave replication there are several modes for Mysql master-slave replication

Spring

1. The underlying code of Spring

2. Bean life cycle

Circular reference issues, and design patterns used in Spring

4. Differences between Spring and springBoot

5. The underlying implementation principle of Spring AOP

How do Spring transactions roll back

7. How does Spring solve the problem of loop dependencies?

8. Understanding, principle and implementation of Spring IOC

9. What is the difference between Bean Factory and FactoryBean? How does the @bean annotation implement Bean injection?

Mybatis

1, hibernate differences

2. What is the cache of Mybatis? Where is the session cache

3, mybatis execution process, need to understand the source code

4. How does Mybatis prevent SQL injection

redis

1. The data structure type of Redis is generally used in what scenarios

2. Underlying data structure of sortedSet

3, use Redis to achieve distributed lock

4. The benefits of redis using single threads

5. How to control multi-threaded concurrency in Redis

6, redis delete key policy

7, Redis active cache, passive cache

8. How to ensure data consistency

9, how to deal with the cluster environment, explain the consistency of the hash

10, explain cache breakdown, cache penetration, cache avalanche, how to solve these problems

11. Implementation of the leaderboard function: using Redis zset; What is the underlying data structure of Zset? What other data structures can do this besides Redis’s Zset

12. Redis cluster type: master-slave mode, Cluster mode and its application

13. Redis data types and application scenarios

zookeeper

1. How does ZooKeeper ensure availability?

2. Principle of Zookeeper

3. When is ZooKeeper used, how does ZooKeeper listen to generated nodes, and how is zK implemented internally

Zookeeper0, Zookeeper1, and zookeeper2: a three-node cluster Describes the entire process from zK startup to EXTERNAL services provided by ZK

5, there is a key, write to zK, write to the success of its general process is what

6. Principle of Zookeeper listener

MQ

1. Structure diagram of MQ

2. How to ensure whether consumers consume

3, the type of ack return

4. How to handle the breakdown of the request process service

5. When will MQ be used? Advantages and disadvantages of MQ, when can YOU not use MQ

springboot

1. What does SpringBoot do during startup?

2, Springboot boot Application class annotation @spring Boot Application description?

3. How does Springboot determine whether the current application is a Web application?

4, Spring Boot integration JSP process, which points need to pay attention to

SpringCloud

1. The difference between SpringCloud and Dubbo

2. What components are used in the project

3. The principle of Eureka, how to ensure high availability, and what is the difference between Eureka and Zookeeper

4. How is Feign called

5. Deal with the configuration effectiveness in the production environment

6. What are Hystrix’s downgrading strategies

7. How does Springcloud Eureka register services and monitor heartbeat? What is its registration process

8. How to quickly find the problem of a service in distributed environment

9. How to verify the identity of the other party when the distributed cluster system provides interfaces

What is the difference between Eureka and ZooKeeper as registries

Linux server

1. How to check the memory usage of Linux applications

2. Linux scripting

Architecture design

1, how to make a second kill system

2. How to realize the technical solution of high availability, high concurrency and high throughput

3. User A sends A request to user B, and user B performs an insert into the database. Design an architecture that guarantees maximum concurrency

Other tips

1. How does Nginx do stream limiting? Token bucket algorithm and leaky bucket algorithm

2. Tomcat tuning

3. Why use RPC framework and when use HTTP requests

4. Tomcat startup principle

5. Http protocol

6. Epoll model

7. How to implement the interface to call the remote service