"Ali Java interview top secret interpretation: 220 classic interview questions to help you face the challenge!"

Java basics:
1. What is the difference between JDK and JRE?

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

3. The hashCode() of the two objects is the same, so must equals() be true?

4. What is the role of final in Java?

5. What is Math. round(-1. 5) equal to in Java?

6. Is String a basic data type?

7. What classes are there for manipulating strings in Java? What's the difference between them?

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

9. How to reverse a string?

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

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

12. What is the difference between a normal class and an abstract class?

13. Can an abstract class be decorated with final?

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

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

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

17. What are the common methods of Files?

For the answer, please go to:
For the answer, please click on the link: Just get the business card at the end of the article

Java container
18. What are the Java containers?

19. What is the difference between Collection and Collections?

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

21. What is the difference between HashMap and Hashtable?

22. How to decide 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 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?

For the answer, please go to:
For the answer, please click on the link: Just get the business card at the end of the article

Java multithreading
35. What is the difference between parallelism and concurrency?

36. What is the difference between thread and process?

37. What is a daemon thread?

38. What are the ways to create threads?

39. What is the difference between runnable and callable?

40. What are the states of a thread?

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

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

44. What is the difference between run() and start() of a thread?

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

46. ​​What are the states of the thread pool?

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

48. How to ensure the safety of multi-threaded operation in Java programs?

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

50. What is deadlock?

51. How to prevent deadlock?

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

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

54. What is the difference between synchronized and volatile?

55. What is the difference between synchronized and Lock?

56. What is the difference between synchronized and ReentrantLock?

57. Tell me about the principle of atomic?

For the answer, please go to:
For the answer, please click on the link: Just get the business card at the end of the article

Java reflection
58. What is reflection?

59. What is Java serialization? When is serialization required?

60. What is a dynamic proxy? Application scenario?

61. How to implement dynamic proxy?

Answer, please move to:

For the answer, please click on the link: You can get the business card at the end of the article

Object copy
62. Why use cloning?

63. How to implement object cloning?

64. What is the difference between deep copy and shallow copy?

Answer, please move to:

For the answer, please click on the link: You can get the business card at the end of the article

javaweb
65. What is the difference between JSP and servlet? What are their characteristics?

66. What built-in objects does JSP have? What are the functions?

67. Tell me about the 4 scopes of JSP?

68. What is the difference between session and cookie?

69. Tell me about the working principle of session?

70. Assuming that the download client prohibits cookies, how to use the session? What is the difference between session and cookie?

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

72. How to avoid SQL injection?

73. What is an XSS attack and how to avoid it?

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

Answer, please move to:

For the answer, please click on the link: You can get the business card at the end of the article

Java exception
75. The difference between throw and throws?

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

77. Which part of try-catch-finally can be saved

78. In try-catch-finally, if there is a return in the catch, will finally still be executed?

79. What are the common exception classes?

Answer, please move to:

For the answer, please click on the link: You can get the business card at the end of the article

Java network programming
80. What do the http response codes 301 and 302 represent? What's the difference?

81. What is the difference between forward and redirect?

82. Briefly describe the difference between tcp and udp?

83. Why does tcp need to shake hands three times, can't it be done twice? Why?

84. Tell me how the tcp sticky packet is generated?

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

86. What is the difference between get and post requests?

87. How to implement cross-domain request?

88. Tell me about the implementation principle of JSONP?

Answer, please move to:

For the answer, please click on the link: You can get the business card at the end of the article

Java design pattern
89. Please list several commonly used design patterns in JDK?

90. What is a design pattern? Have you used any design patterns in your code?

91. What is the singleton design pattern in Java? Please write a thread-safe singleton pattern in Java

92. In Java, what is the observer design pattern (observer design pattern)?

93. What is the main benefit of using the factory pattern? Where is it used?

94. Give a decorator design pattern implemented in Java? Does it operate at the object level or at the class level?

95. Why does ava programming not allow access to non-static variables from static methods?

96. If you need to design an ATM machine, what is your design idea?

97. In the Java language, when to use overloading and when to use rewriting?

98. Please give an example of when you are more inclined to use abstract classes instead of interfaces?

99. What is the difference between simple factory and abstract factory?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

renew:

Spring
100. Why use spring?

101. Explain what is Aop?

102. Explain what is ioc?

103. What are the main modules of spring?

104. What are the commonly used injection methods in spring?

105. Are beans in spring thread-safe?

106. How many bean scopes does spring support?

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

108. What are the implementation methods of spring transactions?

109. Tell me about spring transaction isolation?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

Spring MVC
110. Tell me about the running process of spring mvc?

111. What are the components of spring mvc?

112. What is the role of @RequestMapping?

113. What is the role of @Autowired?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

SpringBoot
114. What is SpringBoot?

115. Why use Spring Boot?

116. What is the SpringBoot core configuration file?

117. What are the types of SpringBoot configuration files? What's the difference?

118. What are the ways of spring boot to achieve hot deployment?

119. What is the difference between jpa and hibernate?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

Spring Cloud
120. What is spring cloud?

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

122. What are the core components of spring cloud?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

Hibernate
123. Why use hibernate?

124. What is an ORM framework?

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

126. How many query methods does hibernate have?

127. Can hibernate entity class be defined as final?

128. Entity classes in hibernate use int and Integer to distinguish

129. How does hibernate work?

130. What is the difference between get() and load()?

131. Tell me about the caching mechanism of hibernate?

132. What are the states of hibernate objects?

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

134. Do hibernate entity classes have to have a parameterless constructor? Why?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

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

136. How many paging methods does MyBatis have?

137. Does RowBounds query all results at once? Why?

138. What is the difference between MyBatis logical paging and physical paging?

139. Does MyBatis support lazy loading? What is the principle of lazy loading?

140. Tell me about the first-level cache and second-level cache of MyBatis?

141. What are the differences between MyBatis and hibernate?

142. What Executors does MyBatis have?

143. What is the implementation principle of the MyBatis pagination plugin?

144. How does MyBatis write a custom plugin?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

RabbitMQ
145. What are the usage scenarios of RabbitMQ?

146. What are the important roles of RabbitMQ?

147. What are the important components of RabbitMQ?

148. What is the role of vhost in RabbitMQ?

149. How are RabbitMQ messages sent?

150. How does RabbitMQ ensure the stability of messages?

151. How does RabbitMQ avoid message loss?

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

153. What are the disadvantages of RabbitMQ persistence?

154. How many broadcast types does RabbitMQ have?

155. How does RabbitMQ implement a delayed message queue?

156. What is the use of RabbitMQ cluster?

157. What are the types of RabbitMQ nodes?

158. What issues should be paid attention to when building a RabbitMQ cluster?

159. Is each node of RabbitMQ a complete copy of other nodes? Why?

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

161. Does RabbitMQ have any requirements for the stop order of cluster nodes?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

Kafka
162. Can kafka be used independently of zookeeper? Why?

163. How many data retention strategies does kafka have?

164. 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 it at this time?

165. How to set kafka topic data storage time

166. What will cause kafka to run slowly?

167. What should be paid attention to when using Kafka cluster?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

Zookeeper
168. What is zookeeper?

169. What functions does zookeeper have?

170. How many deployment modes does zookeeper have?

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

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

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

174. Tell me about the notification mechanism of zookeeper?

175. What is the connection and difference between ZAB and Paxos algorithm?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

MySQL
176. What are the three paradigms of the database?

177. There are a total of 7 pieces of data in an auto-increment table, delete the last 2 pieces of data, restart the MySQL database, and insert another piece of data, what is the id at this time?

178. How to get the current database version?

179. Tell me what is ACID?

180. What is the difference between char and varchar?

181. What is the difference between float and double?

182. What is the difference between inner join, left join and right join in MySQL?

183. How is the MySQL index implemented?

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

185. Tell me about the transaction isolation of the database?

186. Tell me about the engines commonly used in MySQL?

187. Tell me about MySQL's row locks and table locks?

188. Talk about optimistic locking and pessimistic locking?

189. What are the methods for troubleshooting MySQL problems?

190. How to optimize the performance of MySQL?

For answers, please click on the link:

For the answer, please click on the link: You can get the business card at the end of the article

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

192. Redis 有哪些功能?

193. Redis 和 memcache 有什么区别?

194. Redis 为什么是单线程的?

195. 什么是缓存穿透?怎么解决?

196. Redis 支持的数据类型有哪些?

197. Redis 支持的 Java 客户端都有哪些?

198. jedis 和 Redisson 有哪些区别?

199. 怎么保证缓存和数据库数据的一致性?

200. Redis 持久化有几种方式?

201. Redis 怎么实现分布式锁?

202. Redis 分布式锁有什么缺陷?

203. Redis 如何做内存优化?

204. Redis 淘汰策略有哪些?

205.单线程的Redis为什么这么快

答案,请点击链接:文尾名片领取即可

JVM
206. 说一下 JVM 的主要组成部分?及其作用?

207. 说一下 JVM 运行时数据区?

208. 说一下堆栈的区别?

209. 队列和栈是什么?有什么区别?

210. 什么是双亲委派模型?

211. 说一下类装载的执行过程?

212. 怎么判断对象是否可以被回收?

213. Java 中都有哪些引用类型?

214. 说一下 JVM 有哪些垃圾回收算法?

215. 说一下 JVM 有哪些垃圾回收器?

216. 详细介绍一下 CMS 垃圾回收器?

217. 新生代垃圾回收器和老生代垃圾回收器都有哪些?有什么区别?

218. 简述分代垃圾回收器是怎么工作的?

219. 说一下 JVM 调优的工具?

220. 常用的 JVM 调优的参数都有哪些?

答案,点击下方名片即可获取
 

おすすめ

転載: blog.csdn.net/BASK2312/article/details/131920340