Perhaps this is not enough to cover all the Java questions, but I believe you will not “fail” miserably, because it is enough to handle most of the Java interview on the market, because this article has covered a lot of knowledge both in depth and breadth.
Forethought makes sense, unforethought makes waste. Can read here, I believe are the world’s “people who are willing”, or that old saying: God comes to those who are willing! I believe that every step of your efforts will reap unexpected rewards.
Included modules
This paper is divided into nineteen modules, which are: Java Basics, Containers, multithreading, reflection, object copy, Java Web, exceptions, Networking, Design patterns, Spring/Spring MVC, Spring Boot/Spring Cloud, Hibernate, MyBatis, RabbitMQ, Kafka, Zookeeper, MySQL, Redis, JVM as shown below:
With 208 interview questions, this article aims to compile a thorough and authoritative list of interview questions for readers. Let’s get to the topic below.
Vx: Yunduoa2019 or scan the qr code below and follow the guidance of the assistant to obtain it by yourself
Java based
1. What is the difference between JDK and JRE?
2. What is the difference between == and equals?
3. If two objects have the same hashCode(), equals() must also be true, right?
4. What does final do in Java?
5. How much is math.round (-1.5) in Java?
6. Is String a basic data type?
7. What are the classes for manipulating strings in Java? What’s the difference between them?
Is String STR =” I “the same as String STR =new String(” I “)?
9. How to reverse a string?
What are the common methods of the String class?
11. Must abstract classes have abstract methods?
12. What are the differences between ordinary classes and abstract classes?
13. Can abstract classes use final?
What is the difference between an interface and an abstract class?
15. How many IO streams are there in Java?
16. What is the difference between BIO, NIO and AIO?
17. What are the common methods of Files?
Java collection
The container
18. What are Java containers?
19. What’s the difference between Collections and Collections?
20. What is the difference between a List, a Set and a Map?
21. What is the difference between HashMap and Hashtable?
22. How do I decide to use HashMap or TreeMap?
23. How does HashMap work?
24. How does HashSet work?
25. What is the difference between ArrayList and LinkedList?
26. How to convert an array to a List?
27. What is the difference between an ArrayList and a Vector?
28. What’s the difference between Array and ArrayList?
29. What is the difference between poll() and remove() in a Queue?
30. Which collection classes are thread-safe?
31. What is an Iterator?
32. How to use Iterator? What are the characteristics?
33. What is the difference between Iterator and ListIterator?
34. How do I ensure that a collection cannot be modified?
Dockr container
Please forward it and add assistant VX: Yunduoa2019 after following it or scan the qr code below and follow the guidance of the assistant to obtain it by yourself
multithreading
What is the difference between parallelism and concurrency?
36. What is the difference between threads and processes?
37. What is a daemon thread?
38. What are the ways to create a thread?
39. What is the difference between runnable and callable?
What are the states of threads?
41. What’s the difference between sleep() and wait()?
What is the difference between notify() and notifyAll()?
43. What is the difference between run() and start() for a thread?
44. What are the ways to create a thread pool?
What are the states of the thread pool?
46. What is the difference between submit() and execute() methods in the thread pool?
47. How to ensure the safety of multithreading in Java program?
48. What is the principle of synchronized lock escalation in multithreading?
49. What is a deadlock?
50. How do I prevent deadlocks?
51. What is ThreadLocal? What are the usage scenarios?
Talk about the underlying implementation of synchronized.
53. What is the difference between synchronized and volatile?
54. What’s the difference between synchronized and Lock?
What is the difference between synchronized and ReentrantLock?
56. How does atomic work?
reflection
57. What is reflection?
58. What is Java serialization? When is serialization needed?
59. What is a dynamic proxy? What are the applications?
60. How to implement dynamic proxy?
Copy the object
61. Why use cloning?
62. How to implement object cloning?
63. What is the difference between deep copy and shallow copy?
Java Web
64. What is the difference between a JSP and a servlet?
65. What built-in objects does JSP have? What are the effects?
66. What are the four scopes of JSP?
67. What is the difference between session and cookie?
68. How does session work?
69. Can session be implemented if the client disables cookies?
70. What is the difference between Spring MVC and Struts?
71. How do I avoid SQL injection?
72. What is an XSS attack and how can it be avoided?
73. What is a CSRF attack and how can it be avoided?
abnormal
Throws throws 74.
75. What is the difference between final, finally and Finalize?
76. Which part of the try-catch-finally can be omitted?
77. In try-catch-finally, if a catch returns, finally will be executed?
78. What are the common exception classes?
network
79. What do HTTP response codes 301 and 302 represent? What’s the difference?
80. What’s the difference between forward and redirect?
81. Describe the differences between TCP and UDP.
82. Why does TCP require three handshakes? Why is that?
How does TCP sticky packet come into being?
84. What are the OSI seven-tier models?
85. What are the differences between GET and POST requests?
86. How to achieve cross-domain?
87. How does JSONP work?
Design patterns
88. Tell me about a design pattern you are familiar with.
89. What is the difference between a simple factory and an abstract factory?
Spring/Spring MVC
90. Why use Spring?
Explain what AOP is?
Explain what ioc is.
93. What are the main modules of Spring?
What are the common injection methods in Spring?
95. Are beans in Spring thread-safe?
96. How many scopes does Spring support for beans?
97. What are the methods for Spring to automate bean assembly?
What are the ways in which Spring transactions are implemented?
99. What about Transaction isolation in Spring?
100. What about the Spring MVC workflow?
101. What components does Spring MVC have?
102. What does @requestMapping do?
103. What does @autowired do?
Please forward it and add assistant VX: Yunduoa2019 after following it or scan the qr code below and follow the guidance of the assistant to obtain it by yourself
Spring Boot/Spring Cloud
104. What is Spring Boot?
105. Why Spring Boot?
106. What is the Spring Boot core configuration file?
107. What are the types of Spring Boot configuration files? What’s the difference?
108. How can Spring Boot implement hot deployment?
109. What is the difference between JPA and Hibernate?
110. What is Spring Cloud?
111. What does the Spring Cloud circuit breaker do?
112. What are the core components of Spring Cloud?
Hibernate
113. Why use Hibernate?
114. What is ORM Framework?
115. How to view printed SQL statements in The console in Hibernate?
How many query methods does Hibernate have?
117. Can Hibernate entity classes be defined as final?
118. What is the difference between using Integer and int for mapping in Hibernate?
119. How does Hibernate work?
120. The difference between get() and load()?
121. What about Hibernate’s caching mechanism?
122. What are the states of Hibernate objects?
What is the difference between getCurrentSession and openSession in Hibernate?
124. Do Hibernate entity classes have to have parameterless constructors? Why is that?
MyBatis
125. What is the difference between #{} and ${} in MyBatis?
126. How many pagination methods are there in MyBatis?
127. Does RowBounds query all results at once? Why is that?
128. What is the difference between logical paging and physical paging in MyBatis?
129. Does MyBatis support lazy loading? What is the principle of lazy loading?
What about level 1 cache and level 2 cache in MyBatis?
131. What are the differences between MyBatis and Hibernate?
132. What executors do MyBatis have?
133. What is the implementation principle of MyBatis paging plug-in?
134. How to write a custom plug-in for MyBatis?
RabbitMQ
135. What are the usage scenarios for RabbitMQ?
136. What are the important roles of RabbitMQ?
137. What are the important components of RabbitMQ?
138. What is vhost for RabbitMQ?
139. How are RabbitMQ messages sent?
140. How does RabbitMQ ensure message stability?
141. How can RabbitMQ avoid message loss?
142. What are the conditions for successful message persistence?
143. What are the disadvantages of RabbitMQ persistence?
144. How many broadcast types are available for RabbitMQ?
145. How does RabbitMQ implement delayed message queuing?
146. What are RabbitMQ clusters for?
147. What are the types of RabbitMQ nodes?
148. What should I pay attention to when setting up RabbitMQ clusters?
149. Is each RabbitMQ node a full copy of the other nodes? Why is that?
150. What happens when the only disk node in the RabbitMQ cluster crashes?
151. Does RabbitMQ have a stop order for cluster nodes?
Please forward it and add assistant VX: Yunduoa2019 after following it or scan the qr code below and follow the guidance of the assistant to obtain it by yourself
Kafka
Can Kafka be used independently of ZooKeeper? Why is that?
153. How many data retention strategies does Kafka have?
154. Kafka sets 7 days and 10 gigabytes of clean data at the same time, and on the fifth day it reaches 10 gigabytes of clean data.
155. What can cause Kafka to run slowly?
156. What should I pay attention to when using kafka clusters?
Zookeeper
157. What is Zookeeper?
158. What functions does ZooKeeper have?
159. How many deployment modes are available for ZooKeeper?
160. How does ZooKeeper synchronize the status of the primary and secondary nodes?
161. Why have a primary node in a cluster?
162. There are three servers in the cluster and one node is down. Is ZooKeeper still available?
163. What is the notification mechanism of ZooKeeper?
MySQL
164. What are the three paradigms of databases?
MySQL > alter table alter table alter table alter table alter table alter table alter table alter table alter table alter table alter table alter table alter table
166. How do I obtain the current database version?
167. What is ACID?
168. What is the difference between char and varchar?
169. What is the difference between float and double?
170. What is the difference between inner join, left join, right join in MySQL?
171. How is the MySQL index implemented?
172. How to verify that the MySQL index meets the requirement?
173. What about transaction isolation of databases?
174. What is the common MySQL engine?
175. What about row and table locks in MySQL?
176. What about optimistic and pessimistic locks?
177. What are the methods used to troubleshoot MySQL problems?
178. How to optimize MySQL performance?
Please forward it and add assistant VX: Yunduoa2019 after following it or scan the qr code below and follow the guidance of the assistant to obtain it by yourself
Redis
179. What is Redis? What are the usage scenarios?
180. What functions does Redis have?
181. What is the difference between Redis and memcache?
182. Why is Redis single threaded?
183. What is cache penetration? How to solve it?
184. What data types are supported by Redis?
185. What Java clients does Redis support?
186. What are the differences between Jedis and Redisson?
187. How to ensure the consistency of cache and database data?
188. How many ways can Redis persist?
189. How does Redis implement distributed lock?
190. What are the defects of Redis distributed locks?
191. How does Redis optimize memory?
192. What are the Redis elimination strategies?
193. What are the common performance issues with Redis? How to solve it?
Please forward it and add assistant VX: Yunduoa2019 after following it or scan the qr code below and follow the guidance of the assistant to obtain it by yourself
JVM
194. What are the main components of the JVM? And its role?
195. What about the JVM runtime data area?
196. What is the difference between stacks?
197. What are queues and stacks? What’s the difference?
198. What is the parental delegation model?
199. What is the execution of class loading?
200. How to determine whether an object can be reclaimed?
201. What reference types are available in Java?
202. What garbage collection algorithms does the JVM have?
203. What garbage collectors does the JVM have?
204. What about CMS garbage collector?
205. What are the new generation garbage collectors and old generation garbage collectors? What’s the difference?
206. Describe briefly how generational garbage collector works.
207. What about JVM tuning tools?
208. What are the common JVM tuning parameters?
Get the JVM in depth
** Latest Java technology dry documentation: 【Java core knowledge summary 】 covers 29 Java core technology details, JVM, Redis, Nginx, Spring Boot, Spring Cloud, Kafka, concurrent programming, Tomcat, MyBatis, BAT interview questions, Java technology intensive video and so on. ** Please forward it and add assistant VX: Yunduoa2019 after following it or scan the qr code below and follow the guidance of the assistant to obtain it by yourself
Master these knowledge points, the interview in the candidates and can dazzle many, hit 9999 points. Opportunities are reserved for those who are prepared. Only with sufficient preparation can you stand out among the candidates.
284 pages of interview essentials