The most complete collection of Java interview clearance cheats in 2018 1

1. Basics

1.1, Java based
object-oriented features: inheritance, polymorphism and encapsulation

The difference between final, finally, finalize

What are the similarities and differences between Exception, Error, runtime exceptions and general exceptions

Please write 5 common runtime exceptions

What is the difference between int and Integer, the value cache range of Integer

Packaging, boxing and unboxing

String、StringBuilder、StringBuffer

The difference between overloading and rewriting

What is the difference between abstract class and interface

Talk about the use and realization of reflection

Talk about the scene and implementation of custom annotations

The difference between GET and POST for HTTP requests

The difference between Session and Cookie

List your commonly used JDK packages

MVC design ideas

The difference between equals and ==

The difference and connection between hashCode and equals methods

What is Java serialization and deserialization, and how to implement Java serialization? Or please explain the role of Serializable interface

Common methods in the Object class, why is wait notify placed in the Object?

How is the platform independence of Java reflected

The difference between JDK and JRE

What are the new features of Java 8

1.2, the
difference between Java common collection List and Set

The connection between Set and hashCode and equals method

The difference between List and Map

The difference between Arraylist and LinkedList

The difference between ArrayList and Vector

The difference between HashMap and Hashtable

The difference between HashSet and HashMap

The difference between HashMap and ConcurrentHashMap

The working principle and code implementation of HashMap, when to use red-black tree

The problem of HashMap infinite loop in multithreading

HashMap has the problem of Hash DOS attack

The working principle and code implementation of ConcurrentHashMap, how to count all the elements

Handwritten simple HashMap

Have seen the source code of those Java collection classes

1.3, process and thread

The concept of threads and processes, the concept of parallelism and concurrency

Method and realization of thread creation

Ways of communication between processes

Talk about the principle and difference of CountDownLatch and CyclicBarrier

Talk about the principle of Semaphore

Talk about Exchanger principle

Analysis of the principle of ThreadLocal, why OOM appears in ThreadLocal, and the underlying principle

Talk about the realization principle of thread pool

Several implementation methods of thread pool

The life cycle of the thread, how the state is transferred

Can refer to: "Java Multithreaded Programming Core Technology"

1.4, the lock mechanism
to talk about thread safety issues, what is thread-safe, how to ensure the security thread

The concept of re-entry lock, why re-entry lock can prevent deadlock

Four conditions for deadlock (mutual exclusion, request and hold, no deprivation, cyclic waiting)

How to check deadlock (check deadlock through jConsole)

Implementation principle of volatile (instruction rearrangement and memory refresh are prohibited)

Synchronized realization principle (object monitor)

The difference between synchronized and lock

AQS synchronization queue

The concept of CAS lock-free, optimistic lock and pessimistic lock

Common atomic operation classes

What is the ABA problem and how does the JDK solve the ABA problem?

Optimistic lock business scenarios and implementation methods

Common concurrency classes under Java 8 parallel package

The concept of bias lock, lightweight lock, heavyweight lock, and spin lock

Can refer to: "Java Multithreaded Programming Core Technology"

1.5, JVM
JVM runtime memory area division

Examples and causes of memory overflow OOM and stack overflow SOE, how to troubleshoot and solve

How to judge whether the object can be recycled or survived

Common GC recovery algorithms and their meaning

Common JVM performance monitoring and troubleshooting tools: jps, jstat, jmap, jinfo, jconsole, etc.

How to set parameters for JVM

JVM performance tuning

Class loader, parent delegation model, the life cycle of a class, how the class is loaded into the JVM

The process of class loading: loading, verification, preparation, analysis, initialization

Strong reference, soft reference, weak reference, phantom reference

Java Memory Model JMM

1.6, design patterns
common design patterns

The six principles of design patterns and their meaning

Common singleton mode and the advantages and disadvantages of various implementation methods, which one is best, handwriting common simple mode

Application of design patterns in actual scenarios

What design patterns are used in Spring

What design patterns are used in MyBatis

What design patterns are used in your project

Talk about the analysis of the use of design patterns in common open source frameworks

Dynamic agents are important! ! !

1.7, data structure

Tree (binary search tree, balanced binary tree, red-black tree, B tree, B+ tree)

Depth limited algorithm, breadth first algorithm

Kruskal's algorithm, Prin's algorithm, Diklas' algorithm

What is consistent Hash and its principle, Hash ring problem

Common sorting algorithms and search algorithms: fast sorting, binary search, heap sorting, etc.

1.8. Network/IO basic concepts of
BIO, NIO, AIO

What are long and short connections

What is the difference between Http1.0 and 2.0, please refer to "Http 2.0"

The basic concept of Https

Three handshake and four waved hands, why do you need to wave four times

What happens when the URL is entered from the browser to the page load? Refer to "What happened from entering the URL to page loading"

Two, data storage and message queue

2.1.
Precautions for using database MySQL index

What do DDL, DML, and DCL refer to

explain command

left join,right join,inner join

Database transaction ACID (atomicity, consistency, isolation, durability)

Isolation level of things (read uncommitted, read to commit, repeatable read, serializable read)

Dirty read, phantom read, non-repeatable read

Several paradigms of database

Common database commands

Talk about sub-library and sub-table design

Distributed dilemma brought by sub-database and sub-table and countermeasures (how to solve sub-database and sub-table under distributed, global table?)

Talk about SQL optimization

How to troubleshoot and solve the deadlock problem encountered by MySQL

The difference between storage engine InnoDB and MyISAM, advantages and disadvantages, usage scenarios

Index category (B+ tree index, full-text index, hash index), the principle of index

What is Adaptive Hash Index (AHI)

Why use B+tree as the data structure of MySQL index

The difference between clustered index and non-clustered index

Have you ever encountered an index failure, when may it occur, and how to solve it

How to solve limit 20000 loading is slow

How to choose a suitable distributed primary key scheme

Choose the right data storage solution

Several common distributed ID design schemes

Common database optimization solutions, how to optimize the database in your project

2.2.
What data types does Redis Redis have, please refer to "Detailed Explanation of 5 Common Redis Data Types"

Redis internal structure

Redis usage scenarios

Redis persistence mechanism, please refer to "Using Snapshot and AOF to Persist Redis Data to Hard Disk"

Redis cluster solution and implementation

Why is Redis single-threaded?

Cache avalanche, cache penetration, cache warm-up, cache update, cache degradation

The rationality of using cache

Redis common recycling strategy

2.3, Message Queuing
messages using queues scenes

Retransmission compensation solution ideas

Ideas for solving the idempotence of messages

Solutions to the accumulation of messages

How to implement message queue

How to ensure the orderliness of messages

Three, open source frameworks and containers

3.1, SSM/Servlet
Servlet life cycle

The difference between forwarding and redirection

What is the difference between BeanFactory and ApplicationContext

The life cycle of Spring Bean

How to implement Spring IOC

Scope of Bean in Spring, which one is the default

Talk about Spring AOP, Spring AOP implementation principle

Dynamic proxy (CGLib and JDK), advantages and disadvantages, performance comparison, how to choose

Spring transaction implementation, transaction propagation mechanism, default transaction category

The underlying principle of Spring transaction

Spring transaction failure (transaction nesting), JDK dynamic proxy pits Spring transactions, please refer to "JDK dynamic proxy pits Spring transactions!"

How to customize annotations to implement functions

Spring MVC running process

Spring MVC startup process

Spring's singleton implementation principle

What design patterns are used in the Spring framework

Spring other products (Srping Boot, Spring Cloud, Spring Secuirity, Spring Data, Spring AMQP, etc.)

Have you used Spring Boot? Understanding and principles of Spring Boot

The principle of MyBatis

Can refer to "Why is there Spring"

You can refer to "Why Spring AOP"

3.2
Why did Netty choose Netty

Talk about the usage scenarios of Netty in business

Native NIO has an epoll bug in JDK 1.7

What is TCP sticking/unpacking

TCP sticky/unpacking solution

Netty thread model

Talk about Netty's zero copy

Netty internal execution process

Netty reconnection implementation

3.3、Tomcat

Tomcat infrastructure (Server, Service, Connector, Container)

How to load servlet in Tomcat

Pipeline-Valve mechanism

You can refer to: "Four pictures show you the Tomcat system architecture!"

Four, distributed

4.1. Nginx
, please explain what is a C10K problem or do you know what a C10K problem is?

For an introduction to Nginx, please refer to "Introduction to Nginx"

Forward proxy and reverse proxy.

Several common load balancing strategies in Nginx

What are the Master and Worker processes on the Nginx server

What are the advantages of using a "reverse proxy server"?

4.2 Other distributed
to talk about the use of distributed business scenarios

Session distributed solution

Session distributed processing

Application scenarios of distributed locks, causes of distributed locks, basic concepts

Distribution is a common solution for locks

Common solutions for distributed transactions

Algorithm and implementation of cluster and load balancing

To talk about sub-database and sub-table design, please refer to "The specific implementation plan of database sub-table strategy"

Distributed dilemma brought by sub-database and sub-table and countermeasures

4.3、Dubbo

What is Dubbo, please refer to "Introduction to Dubbo"

What is RPC, how to implement RPC, and the implementation principle of RPC, please refer to "HTTP-based RPC Implementation"

What is the concept of SPI in Dubbo

The basic principle and execution process of Dubbo

Five, microservices

5.1, microservices

How is the front-end separation done?

Which frameworks for microservices

What are the common components of Spring Could? Refer to "Spring Cloud Overview"

Do you understand the domain driver? What is a domain-driven model? Congestion model, anemia model

Do you know JWT? What is JWT? Please refer to "JWT for Front-end Separation Tool"

How do you understand RESTful

Talk about how to design a good API

How to understand the idempotence of RESTful API

How to ensure the idempotence of the interface

Talk about CAP theorem, BASE theory

How to consider data consistency issues

Talk about the realization of eventual consistency

For the advantages and disadvantages of microservices, please refer to "Critique of Microservices"

The difference between microservices and SOA

How to split service, horizontal split, vertical split

How to deal with the chain call exception of microservices

How to quickly track and locate problems

How to ensure the security and authentication of microservices

5.2, security concerns
how to prevent common Web attacks, the way how SQL injection

Server communication security attack and defense

Analysis of HTTPS principle, downgrade attack, comparison of HTTP and HTTPS

5.3, performance optimization
performance indicators which

How to find performance bottlenecks

Common means of performance tuning

Talk about how you perform performance tuning in the project

Six, other

6.1, the design capacity
to talk about you've used in the project UML diagram

How do you consider componentization, serviceization, and system splitting

How to design the spike scene

Can refer to: "Summary of the technical challenges, coping strategies and architecture design of the spike system one or two!

6.2, traffic engineering
talk about your development process, how to automate deployment

How do you communicate with the team

How do you conduct a code review

Talk about your understanding of technology and business

Talk about the most difficult bug you encountered in the project and how to solve it

Introduce a project that you think is the most valuable in your work, as well as the role in the process, the problems solved, and what do you think your project has inadequate

6.3, soft power
to talk about your strengths and weaknesses, highlights

Tell me about what books you are reading recently, what blogs, what new technologies are you researching, and then look at the source code of those open source projects

Tell me about the most meaningful technical books you think

What to do after work, how to learn in normal times, how to improve one's abilities

Talk about thinking about personal development direction

Talk about what capabilities you think a server-side development engineer should have

Tell me what kind of architect you think and what the architect does

How to look at the problem of overtime

Of course, a complete interview is definitely more than the above-mentioned knowledge points, other things such as: Linux, data structures, algorithms, logical thinking questions, system design questions, career planning, etc. will be involved! In short, adequate preparation is the only magic weapon to deal with all interviews!

Welcome to leave a message to discuss the above issues! Any interview questions that are frequently asked are also welcome to leave a comment!

Guess you like

Origin blog.csdn.net/yipianfeng_ye/article/details/82386804