I have seen through the internal information of Alibaba interviewers, and I will sort out a collection of high-frequency Java interview questions in 2020 (including answers) for you

Perhaps this interview question is not enough to cover all Java problems, but with it, I believe you will not "fail" miserably, because with it, it is enough to deal with most of the Java interviews on the market, because This article has covered a lot of knowledge in terms of depth and breadth.

Forewarned is forearmed, without prejudging the waste. Those who can read this, I believe they are all the "hearted people" in this world, or the old saying: God pays off! I believe that every step of your efforts will yield unexpected returns.

Included modules

This article is divided into nineteen modules, namely:  Java Foundation, Container, Multithreading, Reflection, Object Copy, Java Web, Exception, Network, Design Pattern, Spring/Spring MVC, Spring Boot/Spring Cloud, Hibernate, MyBatis, RabbitMQ , Kafka, Zookeeper, MySQL, Redis, JVM  , as shown in the following figure:

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

A total of 208 interview questions are included. The purpose of this article is to compile a detailed and authoritative interview list for readers and friends. Let's enter the topic together.

This article only lists the interview questions, (answer) to get the following picture:

 

Java basics

1. What is the difference between JDK and JRE?

2. What is the difference between == and equals?

3. If the hashCode() of two objects is the same, equals() must also be true, right?

4. What is the role of final in Java?

5. What is the equivalent of Math. round(-1. 5) in Java?

6. Is String a basic data type?

7. What are the classes of manipulation strings in Java? What is the difference between them?

8. Is String str="i" the same as String str=new String("i")?

9. How to reverse the string?

10. What are the commonly used methods of the String class?

11. Does an abstract class have to have abstract methods?

12. What are the differences between ordinary classes and abstract classes?

13. Can abstract classes use final modification?

14. What is the difference between an interface and an abstract class?

15. How many types of IO streams are in Java?

16. What is the difference between BIO, NIO and AIO?

17. What are the common methods of Files?

Java collection

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

container

18. What are the Java containers?

19. What is the difference between Collection and Collections?

20. What is the difference between List, Set and Map?

21. What is the difference between HashMap and Hashtable?

22. How to decide whether to use HashMap or TreeMap?

23. Tell me about the implementation principle of HashMap?

24. Tell me about the implementation principle of HashSet?

25. What is the difference between ArrayList and LinkedList?

26. How to realize the conversion between array and List?

27. What is the difference between ArrayList and Vector?

28. What is the difference between Array and ArrayList?

29. What is the difference between poll() and remove() in Queue?

30. Which collection classes are thread safe?

31. What is Iterator?

32. How to use Iterator? What are the characteristics?

33. What is the difference between Iterator and ListIterator?

34. How to ensure that a collection cannot be modified?

dockr container

Forward + follow, privately message me [interview] to receive the answers to the interview questions in the article

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

Multithreading

35. What is the difference between parallel and concurrency?

36. The difference between thread and process?

37. What is a daemon thread?

38. What are the ways to create threads?

39. Tell me about the difference between runnable and callable?

40. What are the statuses of threads?

41. What is the difference between sleep() and wait()?

42. What is the difference between notify() and notifyAll()?

43. What is the difference between thread run() and start()?

44. What are the ways to create a thread pool?

45. What are the statuses of the thread pool?

46. ​​What is the difference between the submit() and execute() methods in the thread pool?

47. How to ensure the safe operation of multiple threads in Java programs?

48. What is the principle of synchronized lock upgrade in multithreading?

49. What is a deadlock?

50. How to prevent deadlock?

51. What is ThreadLocal? What are the usage scenarios?

52. Tell me about the underlying implementation principle of synchronized?

53. What is the difference between synchronized and volatile?

54. What is the difference between synchronized and Lock?

55. What is the difference between synchronized and ReentrantLock?

56. Tell me about the principle of atomic?

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

reflection

57. What is reflection?

58. What is Java serialization? Under what circumstances need serialization?

59. What is a dynamic agent? What are the applications?

60. How to implement dynamic proxy?

Object copy

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 JSP and servlet?

65. What are the built-in objects of JSP? What are the roles?

66. What are the four scopes of JSP?

67. What is the difference between session and cookie?

68. Tell me about the working principle of session?

69. Can the session be used if the client prohibits cookies?

70. What is the difference between spring mvc and struts?

71. How to avoid SQL injection?

72. What is XSS attack and how to avoid it?

73. What is a CSRF attack and how to avoid it?

abnormal

74. The difference between throw and throws?

75. What is the difference between final, finally, and finalize?

76. Which part of try-catch-finally can be omitted?

77. In try-catch-finally, if the catch is returned, will finally be executed?

78. What are the common exception classes?

The internet

79. What do the http response codes 301 and 302 represent? What's the difference?

80. The difference between forward and redirect?

81. Briefly describe the difference between tcp and udp?

82. Why does tcp need to shake hands three times, can't it work twice? why?

83. Tell me about how tcp sticky packets are generated?

84. What are the seven-layer models of OSI?

85. What is the difference between get and post request?

86. How to achieve cross-domain?

87. Tell me about the principle of JSONP implementation?

Design Patterns

88. Tell me about the design patterns you are familiar with?

89. What is the difference between a simple factory and an abstract factory?

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

Spring/Spring MVC

90. Why use spring?

91. Explain what is aop?

92. Explain what is ioc?

93. What are the main modules of spring?

94. What are the commonly used injection methods for spring?

95. Are beans in spring thread safe?

96. What scope of beans does spring support?

97. What are the ways to automatically assemble beans in spring?

98. What are the implementation methods of spring transaction?

99. Tell me about Spring's transaction isolation?

100. Tell me about the running process of spring mvc?

101. What are the components of spring mvc?

102. What is the role of @RequestMapping?

103. What is the role of @Autowired?

Forward + follow, privately message me [interview] to receive the answers to the interview questions in the article

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

Spring Boot/Spring Cloud

104. What is spring boot?

105. Why use spring boot?

106. What is the spring boot core configuration file?

107. What types of spring boot configuration files are there? What is the difference between them?

108. What are the ways spring boot can achieve hot deployment?

109. What is the difference between jpa and hibernate?

110. What is spring cloud?

111. What is the function of spring cloud circuit breaker?

112. What are the core components of spring cloud?

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

Hibernate

113. Why use hibernate?

114. What is the ORM framework?

115. How to view the printed SQL statement in the console in hibernate?

116. 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. Tell me about hibernate's caching mechanism?

122. What are the statuses of hibernate objects?

123. What is the difference between getCurrentSession and openSession in hibernate?

124. Does hibernate entity class have to have a parameterless constructor? why?

MyBatis

125. What is the difference between #{} and ${} in MyBatis?

126. How many paging methods does MyBatis have?

127. Does RowBounds query all results at once? why?

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?

130. Tell me about the primary cache and secondary cache of MyBatis?

131. What are the differences between MyBatis and hibernate?

132. What executors (Executor) does MyBatis have?

133. What is the realization principle of the MyBatis paging plug-in?

134. How to write a custom plug-in for MyBatis?

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

RabbitMQ

135. What are the usage scenarios of RabbitMQ?

136. What are the important roles of RabbitMQ?

137. What are the important components of RabbitMQ?

138. What is the role of vhost in RabbitMQ?

139. How are RabbitMQ's messages sent?

140. How does RabbitMQ ensure the stability of messages?

141. How does RabbitMQ avoid message loss?

142. What are the conditions to ensure the success of message persistence?

143. What are the disadvantages of RabbitMQ persistence?

144. How many broadcast types does RabbitMQ have?

145. How does RabbitMQ implement delayed message queue?

146. What is the use of RabbitMQ cluster?

147. What are the types of RabbitMQ nodes?

148. What issues should be paid attention to when setting up RabbitMQ cluster?

149. Is each node of RabbitMQ a complete copy of other nodes? why?

150. What happens if the only disk node in the RabbitMQ cluster crashes?

151. Does RabbitMQ have any requirements for the stopping order of cluster nodes?

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

Kafka

152. Can Kafka be used separately from zookeeper? why?

153. How many data retention strategies does Kafka have?

154. Kafka has set 7 days and 10G to clear data at the same time. By the fifth day, the message reached 10G. How will Kafka handle this?

155. What situation will cause Kafka to run slower?

156. What should I pay attention to when using kafka cluster?

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

Zookeeper

157. What is zookeeper?

158. What are the functions of zookeeper?

159. How many deployment modes does zookeeper have?

160. How does zookeeper ensure the synchronization of the master and slave nodes?

161. Why is there a master node in the cluster?

162. There are 3 servers in the cluster, and one of the nodes is down. Can zookeeper still be used at this time?

163. Tell me about the notification mechanism of zookeeper?

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

MySQL

164. What are the three paradigms of the database?

165. There are a total of 7 pieces of data in an auto-increment table. The last 2 pieces of data are deleted, the MySQL database is restarted, and another piece of data is inserted. What is the id at this time?

166. How to get 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 connection, left connection and right connection of MySQL?

171. How is the MySQL index implemented?

172. How to verify whether the MySQL index meets the requirements?

173. Talk about the transaction isolation of the database?

174. What are the commonly used engines for MySQL?

175. Tell me about row locks and table locks in MySQL?

176. Talk about optimistic locking and pessimistic locking?

177. What are the methods for MySQL troubleshooting?

178. How to optimize the performance of MySQL?

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

Redis

179. What is Redis? What are the usage scenarios?

180. What are the functions of Redis?

181. What is the difference between Redis and memcache?

182. Why is Redis single-threaded?

183. What is cache penetration? How to deal with it?

184. What are the data types supported by Redis?

185. What are the Java clients supported by Redis?

186. What is the difference between jedis and Redisson?

187. How to ensure the consistency of cache and database data?

188. There are several ways to persist Redis?

189. How does Redis implement distributed locks?

190. What are the defects of Redis distributed lock?

191. How does Redis optimize memory?

192. What are the Redis elimination strategies?

193. What are the common performance problems of Redis? How to solve it?

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

JVM

194. Tell me about the main components of JVM? And its role?

195. Tell me about the JVM runtime data area?

196. Tell me about the difference between stacks?

197. What are queues and stacks? What's the difference?

198. What is the parental delegation model?

199. Tell me about the execution process of class loading?

200. How to judge whether the object can be recycled?

201. What reference types are there in Java?

202. Tell me about what garbage collection algorithms the JVM has?

203. Tell me about what garbage collectors the JVM has?

204. Tell me more about the CMS garbage collector?

205. What are the new generation garbage collectors and the old generation garbage collectors? What's the difference?

206. Briefly describe how the generational garbage collector works?

207. Tell me about the tools of JVM tuning?

208. What are the commonly used JVM tuning parameters?

Explain the JVM in a simple way

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

The latest Java technology dry goods documentation: [Java core knowledge points] covers 29 detailed Java core technologies, JVM, Redis, Nginx, Spring Boot, Spring Cloud, Kafka, concurrent programming, Tomcat, MyBatis, BAT interview questions, Java Technical intensive video, etc.

 

Having mastered these knowledge points, you can get a lot of eye-catching among candidates during the interview, crit 9999 points. Opportunities are reserved for those who are prepared. Only with sufficient preparation can you stand out among the candidates.

 

284 page test core knowledge points

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

 

A collection of high-frequency Java interview questions in 2020 (including answers), so that your interview will be unimpeded!

Guess you like

Origin blog.csdn.net/qq_46388795/article/details/108954546