Java Interview Question Collection (1) Question List

Java basics:

1.1, Java basics

(1) Object-oriented features: inheritance, encapsulation and polymorphism

(2) The difference between final, finally, and finalize

(3) What are the similarities and differences between Exception, Error, runtime exception and general exception

(4) Please write 5 common runtime exceptions

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

(6) Packing, packing and unpacking

(7)String、StringBuilder、StringBuffer

(8) The difference between overloading and rewriting

(9) Difference between abstract class and interface

(10) Talk about the use and implementation of reflection

(11) Talk about the scene and implementation of custom annotations

(12) The difference between GET and POST methods of HTTP requests

(13) Difference between Session and Cookies

(14) List your commonly used JDK packages

(15) MVC Design Ideas

(16) The difference between equals and ==

(17) Differences and connections between hashCode and equals methods

(18) What is Java serialization and deserialization, and how to implement Java serialization? Or please explain what the Serializable interface does

(19) The commonly used methods in the Object class, why is wait notify placed in Object?

(20) How is the platform independence of Java manifested?

(21) The difference between JDK and JRE

(22) What are the new features of Java 8

1.2 Java Common Collections

(23) Difference between List and Set

(24) The connection between Set and hashCode and equals method

(25) Difference between List and Map

(26) Difference between ArrayList and LinkedList

(27) Difference between ArrayList and Vector

(28) The difference between HashMap and Hashtable

(29) The difference between HashSet and HashMap

(30) The difference between HashMap and ConcurrentHashMap

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

(32) The problem of HashMap infinite loop under multi-threading conditions

(33) Hash Dos attack problem in HashMap

(34) The working principle and code implementation of ConcurrentHashMap, how to count the number of all elements

1.3 Processes and threads

(35) The concepts of threads and processes, the concepts of parallelism and concurrency

(36) The way and implementation of thread creation

(37) Inter-process communication method

(38) Talk about the principles and differences between CountDownLatch and CycliBarrier

(39) Talk about the Semaphore principle

(40) Talk about the principle of Exchanger

(41) Analysis of the principle of ThreadLocal, why does OOM appear in ThreadLocal, and the underlying principle

(42) Talk about the implementation of the thread pool

(43) What are the implementation methods of the thread pool?

(44) How the life cycle and state of the thread are transferred

1.4 Lock Mechanism

(45) Talk about thread safety, what is thread safety, and how to ensure thread safety

(46) The concept of reentrant locks, why can reentrant locks prevent deadlocks?

(47) How to check for deadlock (check deadlock via jConsole)

(48) volatile implementation principle (forbid instruction rearrangement, refresh memory)

(49) The principle of synchronized implementation (object monitor)

(50) The difference between synchronized and lock

(51) AQS synchronization queue

(52) CAS lock-free concept, optimistic locking and pessimistic locking

(53) Commonly used atomic operations

(54) What is the ABA problem, and how does the JDK solve the ABA problem?

(55) Business scenarios and implementation methods of optimistic locking

(56) Common concurrent classes under Java 8 concurrent packages

(57) Concepts of biased locks, lightweight locks, heavyweight locks, and spin locks

1.5 JVM

(58) Memory area division during JVM runtime

(59) Examples and causes of memory overflow OOM and stack overflow SOE, how to troubleshoot and solve them

(60) How to judge whether an object can be recycled or survived

(61) Common GC recovery algorithms and their meanings

(62) Common JVM performance monitoring and troubleshooting tools (jps, jstat, jmap, jinfo, jconsole)

(63) How JVM sets parameters

(64) JVM performance tuning

(65) Class loader, parent delegation model, life cycle of a class, how is class loaded into JVM?

(66) The process of class loading (loading, verification, preparation, parsing, initialization)

(67) Strong reference, soft reference, weak reference, virtual reference

(68) Java Memory Model JMM

1.6 Design Patterns

(69) Six principles of design patterns and their meanings

(70) Commonly used singleton pattern, advantages and disadvantages of implementation

(71) Which design patterns are used in Spring

(72) Design patterns used in Mybatis

(73) Design patterns used in common open source frameworks

(74) Proxy mode, factory mode

1.7 Network and I/O Basics

(75) Concepts of BIO, NIO, AIO

(76) What is a long connection and a short connection

(77) What is the difference between Http1.0 and 2.0?

(78) The concept of HTTPS

(79) The concept of three handshakes and four waves

 

Write down the questions you may ask in the interview first, and then write down the answers and answers.

Guess you like

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