Summary of Java stereotyped interview questions that can be called the interview ceiling in 2022

foreword

Nowadays, the essence of Java interviews is stereotyped essays. Only by memorizing the interview questions of stereotyped essays can you perform well in the interview. Golden September, Silver and October recruitment golden season has arrived! When you are struggling in the postgraduate entrance examination and job hunting, you may wish to read the interview questions first, after all, our ultimate goal is to find a job you like! Good jobs come early, so students should prepare early!

1. The difference between JDK, JRE. JVM

  • JDK: Java Standard Development Kit, which provides various tools and resources needed to compile and run Java programs, including Java compiler, Java runtime environment, and commonly used Java class libraries, etc.

  • JRE: Java runtime environment, used to run Java bytecode files. JRE includes the JVM and the class library required for JVM work. Ordinary users only need to install JRE to run Java programs, while program developers must install JDK to compile and debug programs.

  • JVM: Java virtual machine, which is a part of JRE, is the core part of the entire java cross-platform implementation, and is responsible for running bytecode files.

2. The relationship between hashCode() and equals()

In Java, each object can call its own hashCode() method to obtain its own hash value (hashCode), which is equivalent to the fingerprint information of the object. Generally speaking, there are no two identical fingerprints in the world. But in Java, it is impossible to be so absolute, but we can still use hashCode to make some early judgments, such as:

  • If the hashCode of two objects is not the same, then the two objects must be different objects

  • If the hashCode of two objects is the same, it does not mean that the two objects must be the same object, or they may be two objects

  • If two objects are equal, then their hashCode must be the same

3. The difference between String.StringBuffer.StringBuilder

  • String is immutable. If you try to modify it, a new string object will be generated. StringBuffer and StringBuilder are mutable

  • StringBuffer is thread-safe, and StringBuilder is not thread-safe, so StringBuilder will be more efficient in a single-threaded environment

4. The difference between extends and super in generics

  • <? extends T> means any subclass of T including T

  • <? super T> means the parent class of any T including T

5. The difference between == and equals method

  • ==: If it is a basic data type, the comparison is the value; if it is a reference type, the comparison is the reference address

  • equals: Look at the comparison logic of each class after rewriting the equals method. For example, the String class is a reference type, but the equals method is rewritten in the String class. The internal comparison of the method is the string in the string. Whether the characters are all equal.

6. The difference between overloading and rewriting

7. The difference between List and Set

8. The difference between ArrayList and LinkedList

9. Talk about the expansion mechanism of ConcurrentHashMap

10. What changes happened to Jdk1.7 to Jdk1.8 HashMap (bottom layer)?

11. Talk about the Put method of HashMap

12. Deep copy and shallow copy

13. Principle of HashMap expansion mechanism

14. What is the underlying principle of CopyOnWriteArrayList

15. What is bytecode? What are the benefits of using bytecode?

16. What is the exception system in Java?

17. In Java's exception handling mechanism, when should an exception be thrown and when should an exception be caught?

18. What class loaders are there in Java

19. Talk about the class loader parent delegation model

20. What are the thread shared areas in the JVM

21. How to troubleshoot JVM problems in your project

22. What process does an object go through from being loaded into the JVM to being cleared by the GC?

23. How to determine - is an object garbage?

24. What garbage collection algorithms does the JVM have?

25. What is STW?

26. What are the JVM parameters? .

27. Talk about the understanding of thread safety

28. Understanding of daemon threads

29. The underlying principle of ThreadLocal

30. Concurrency and parallelism. difference between serial

31. How to avoid Java deadlock?

32. The underlying working principle of the thread pool

33. Why does the thread pool add queues first instead of creating the largest thread first?

34. The underlying implementation of fair locks and unfair locks in ReentrantL 0ock

35. The difference between tryLock) and lock) methods in ReentrantL.ock

36. The difference and underlying principle between CountDownLatch and Semaphore

37. Sychronized biased locks, lightweight locks, and heavyweight locks

38. The difference between Sychronized and ReentrantLock

39. Talk about your understanding of AQS, how does AQS implement reentrant locks?

40. Talk about your understanding of I0C

41. Singleton Bean and Singleton Pattern

42. Spring transaction propagation mechanism

43. When will the Spring transaction fail?

44. What are the steps in the life cycle of Bean creation in Spring

45. Is the Bean in Spring thread-safe?

46. ​​What is the difference between ApplicationContext and BeanFactory

47. How are transactions implemented in Spring

48. When will @Transactional fail in Spring?

49. What is the startup process of the Spring container

50. What design patterns does Spring use

51. Commonly used annotations in Spring Boot and their underlying implementation

52. How does Spring Boot start Tomcat

53. Advantages and disadvantages of Mybatis

54. What is the difference between #0 and $0?

55. Basic principles of indexing

56. What are the principles of index design?

57. Basic characteristics and isolation levels of transactions

58. What is MVCC

59. Briefly describe the difference between MyISAM and InnoDB

60. What does each field sub-table represent in the result of the Explain statement?

61. What is index coverage

62. What is the leftmost premise principle?

63. How does Innodb implement transactions

64. The difference between B-tree and B+ tree, why Mysq uses B+ tree

65. What are the Mysql locks and how to understand them

66. Mysq | How to optimize the query?

67. What are RDB and AOF

68. Deletion strategy for Redis expired keys

69. Briefly describe Redis transaction implementation

70. The core principle of Redis master-slave replication

71. What data structures does Redis have? What are the typical application scenarios?

72. How is the bottom layer of Redis distributed lock implemented?

73. The core principle of Redis master-slave replication

74. Redis cluster strategy

75. Cache penetration. What are cache breakdown and cache avalanche?

76. How Redis and Mysql guarantee data- - to

77. Redis's cultural mechanism

78. Why is Redis single-threaded so fast?

80. What is CAP theory

81. What is BASE theory

82. What is RPC?

83. What are the data consistency models?

84. What is distributed D? What solutions are there?

85. What is the most used field of distributed locks? What are the implementation plans?

86. What is a distributed transaction? What are the implementation plans?

87. What is the ZAB protocol?

88. Why Zookeeper can be used as a registration center

89. What is the process of leader election in Zookeeper?

90. How to synchronize data between nodes in a Zookeeper cluster

91. Which load balancing strategies does Dubbo support?

92. How does Dubbo complete service export?

93. How does Dubbo complete the service introduction?

94. What is the architecture design of Dubo?

95. What are the load balancing algorithms?

96. Under the distributed architecture, what is the solution for Session sharing?

97. How to realize the idempotency of the interface

98. Briefly describe the naming service of zk. configuration management, cluster management

99. Talk about the watch mechanism in Zookeeper

100. The difference between Zookeeper and Eureka

101. How to solve the unique-primary key problem after storage splitting

102. Principle of Snowflake Algorithm

103. How to solve the query problem without partition key

104. What are the common components of Spring Cloud and what are their functions?

105. How to avoid cache penetration and cache breakdown. Cache avalanche?

106. What are the commonly used caching schemes in distributed systems

107. What are the strategies for cache expiration?

108. Common cache elimination algorithms

109. Bloom filter principle, advantages and disadvantages

110. Distributed cache addressing algorithm

111. What are the differences between Spring Cloud and Dubbo?

112. What is Service Xuegang? What is Service Current Limit?

113. What is a service circuit breaker? What is a service downgrade? What is the difference?

114. What are the relationships and differences between SOA, distributed, and microservices?

115. How to split microservices?

116. How to design high cohesion and low coupling microservices?

117. Have you ever learned about DDD domain-driven design?

118. What is Zhongtai?

119. How do you ensure the agile development of microservices in your project?

120. How to select the type of message queue?

121. How is the transaction message of RocketMQ realized

122. Why doesn't RocketMO use okeeper as a registration center?

123. Implementation principle of RocketMQ

124. Why is RocketMQ fast?

125. How does the message queue ensure reliable message transmission

126. What are the functions of message queues?

127. What is a dead letter queue? What is a delay queue?

128. How to ensure the efficient reading and writing of messages?

129. The difference between epoll and poll

130. TCP's three-way handshake and four-way wave

131. What steps does the browser go through from sending a request to receiving a response?

132. What is a cross-domain request? What is the problem? How to solve it?

133. What is zero copy?

In order not to affect your reading experience, the real interview questions of this Java stereotyped essay have been sorted out for you .

Guess you like

Origin blog.csdn.net/l688899886/article/details/126631127
Recommended