Suitable for reading people
- Junior/middle/senior java programmers who need interviews
- People who want to check for omissions
- People who want to continuously improve and expand their java technology stack
- java interviewer
Specific interview questions
Let’s take a look at the 208 interview questions, the specific contents.
1. Java Basics
What is the difference between it 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?
What is the function in java?
What is the (-1.5) in?
Is it the basic data type?
What are the classes of operation strings in? What is the difference between them?
Is str="i" the same as String str=new String("i")?
9. How to reverse string?
What are the common methods of the class?
11. Do abstract classes have abstract methods?
12. What are the differences between ordinary classes and abstract classes?
13. Can abstract classes be modified using final?
14. What is the difference between an interface and an abstract class?
How many types of IO streams are divided into?
What is the difference between NIO and AIO?
What are the common methods?
2. Container
What containers are there?
What is the difference between Collections?
What is the difference between , Set and Map?
What is the difference between Hashtable?
22. How to decide whether to use HashMap or TreeMap?
23. Let’s talk about the implementation principle of HashMap?
24. Let’s talk about the implementation principle of HashSet?
What is the difference between LinkedList?
26. How to implement the conversion between an array and a List?
What is the difference between it and Vector?
What is the difference between ArrayList?
29. What is the difference between poll() and remove() in Queue?
30. Which collection classes are thread-safe?
31. What is iterator?
How to use it? What are the characteristics?
What is the difference between ListIterator?
34. How to ensure that a collection cannot be modified?
3. Multi-threading
35. 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 threads?
39. Let’s talk about the difference between runnable and callable?
40. What are the states of threads?
What is the difference between () and wait()?
What is the difference between () and notifyAll()?
43. What is the difference between run() and start() of threads?
44. What are the ways to create a thread pool?
45. What are the states of thread pools?
46. What is the difference between submit() and execute() methods in a thread pool?
47. How to ensure the safety of multi-threaded operation in a java program?
48. What is the principle of upgrading multi-threaded locks?
49.What is deadlock?
50. How to prevent deadlocks?
What is it? What are the usage scenarios?
52. Let’s talk about the underlying implementation principle of synchronized?
What is the difference between volatile?
What is the difference between Lock?
What is the difference between ReentrantLock?
56. Tell me the principle of atomic?
4. Reflection
57.What is reflection?
58.What is java serialization? Under what circumstances does serialization need?
59.What is a dynamic proxy? What applications are there?
60. How to implement dynamic proxy?
5. Object copy
61. Why use cloning?
62. How to implement object cloning?
63. What is the difference between deep copy and shallow copy?
6. Java Web
What is the difference between servlet?
What are the built-in objects? What are the functions?
66. Let’s talk about the 4 scopes of jsp?
What is the difference between cookies?
68. Tell me how session works?
69. If the client prohibits cookies, can the session be implemented? Can it still be used?
What is the difference between mvc and struts?
71. How to avoid sql injection?
72. What is an XSS attack and how to avoid it?
73. What is a CSRF attack and how to avoid it?
7. Abnormality
What's the difference with throws?
, finally, finalize What is the difference?
Which part in -catch-finally can be omitted?
-catch-finally, if return in catch is in, will finally be executed?
78. What are the common exception classes?
8. Internet
What do response codes 301 and 302 represent? What's the difference?
What's the difference between redirect?
81. Briefly describe the difference between tcp and udp?
Why do you need to shake hands three times, but not twice? Why?
83. Let me talk about how the tcp sticky packet is produced?
What are the seven-layer models?
What are the differences between post requests?
86. How to achieve cross-domain?
87. Let’s talk about the JSONP implementation principle?
9. Design Pattern
88. Tell me about the design patterns you are familiar with?
89. What is the difference between a simple factory and an abstract factory?
10. Spring/Spring MVC
90. Why use spring?
91. Explain what aop is?
92. Explain what is ioc?
What are the main modules?
What are the commonly used injection methods?
Is the bean in thread safe?
How many bean scopes are supported?
What are the ways to auto-assemble beans?
What are the transaction implementation methods?
99. Let’s talk about spring’s transaction isolation?
100. Tell me about the spring mvc operation process?
What components are mvc?
102. What is the function of @RequestMapping?
103. What is the function of @Autowired?
11. Spring Boot/Spring Cloud
104.What is spring boot?
105. Why use spring boot?
What is the boot core configuration file?
What are the types of boot configuration files? What is the difference between them?
What are the ways to achieve hot deployment in boot?
What is the difference between hibernate?
110.What is spring cloud?
What is the function of cloud circuit breaker?
What are the core components of cloud?
12. Hibernate
113. Why use hibernate?
114.What is an ORM framework?
How to view printed sql statements in the console?
How many query methods are there?
Can entity classes be defined as final?
118. What is the difference between using Integer and int for mapping in hibernate?
How does it work?
The difference between () and load()?
121. Let’s talk about the caching mechanism of hibernate?
What are the states of the object?
123. What is the difference between getCurrentSession and openSession in hibernate?
Do entity classes need to have parameter constructors? Why?
13. Mybatis
What is the difference between #{} and ${} in?
How many ways to paging?
Is it a one-time query to all the results? Why?
What is the difference between logical paging and physical paging?
Is lazy loading supported? What is the principle of lazy loading?
130. Let’s talk about mybatis’ first-level cache and second-level cache?
What are the differences between hibernate?
What executors are there?
What is the implementation principle of the paging plugin?
How to write a custom plugin?
14. RabbitMQ
What are the usage scenarios?
What are the important roles?
What are the important components?
What is the role of vhost?
How is the message sent?
How to ensure the stability of the message?
How to avoid message loss?
142. What are the conditions to ensure the successful persistence of messages?
What are the disadvantages of persistence?
How many types of broadcasts are there?
How to implement delayed message queue?
What is the use of a cluster?
What are the types of nodes?
What issues should be paid attention to when building a cluster?
Is each node a complete copy of other nodes? Why?
What happens if the only disk node in the cluster crashes?
Are there any requirements for the order of stopping the cluster nodes?
15. Kafka
Can it be used alone without zookeeper? Why?
How many data retention strategies are there?
At the same time, 7 days and 10G clear data were set. By the fifth day, the message reached 10G. How will kafka deal with this?
155.What situation will cause kafka to run slower?
156. What should I pay attention to when using a kafka cluster?
16. Zookeeper
What is it?
What functions are there?
How many deployment modes are there?
How to ensure the state synchronization of master and slave nodes?
161. Why do we need 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. Let’s talk about the notification mechanism of zookeeper?
17. MySql
164. What are the three paradigms of databases?
165. There are 7 pieces of data in a self-increasing table. The last 2 pieces of data were deleted, the mysql database was restarted, and another piece of data was inserted. What is the id at this time?
166. How to get the current database version?
167. Let’s talk about what ACID is?
What is the difference between varchar?
What is the difference between it and double?
What is the difference between inner connection, left connection and right connection?
How is indexed implemented?
172. How to verify whether the index of mysql meets the needs?
173. Let’s talk about the transaction isolation of the database?
174. Let me talk about the commonly used engines of mysql?
175. Let’s talk about mysql’s row locks and table locks?
176. Let’s talk about optimism and pessimistic locks?
What are the methods for troubleshooting?
178. How to optimize mysql performance?
18. Redis
What is it? What are the usage scenarios?
What are the functions?
What is the difference between memecache?
Why is it single threaded?
183.What is cache penetration? How to solve it?
What are the supported data types?
What are the supported java clients?
What is the difference between redisson?
187. How to ensure the consistency of cache and database data?
How many ways to persist?
How to implement distributed locks?
What are the shortcomings of distributed locks?
How to optimize memory?
What are the elimination strategies?
What are the common performance problems? How to solve it?
Nineteen. JVM
194. Let’s talk about the main components of jvm? And its function?
195. Let’s talk about the jvm runtime data area?
196. Let’s talk about the difference between stacks?
197. What are queues and stacks? What's the difference?
198. What is the parent delegation model?
199. Let’s talk about the execution process of class loading?
200. How to determine whether the object can be recycled?
What are the reference types in it?
202. Let me talk about what garbage collection algorithms are there in jvm?
203. Let me talk about what garbage collectors are there in jvm?
204. Let me introduce the CMS garbage collector in detail?
205. What are the new generation of garbage collectors and the old generation of garbage collectors? What's the difference?
206. Briefly describe how the generational garbage collector works?
207. Let me talk about the tools for jvm tuning?
208. What are the commonly used jvm tuning parameters?