Interview question 7

1. The difference between Filter and interceptor.
Filter is a specification of tomcat. It intercepts the request object before the request and performs related filtering dofilter, such as url interception request for static files, adding request parameters, permission check, sensitive character check, etc. After the request, it will Execute dofilter once. The difference is, 1. Filter is only tomcat specification, interceptor is spring specification. 2. The timing of execution is different, dofilter-execute request-dofilter, interceptor intercepts again when executing the request, dofilter-interceptor prehandler-execute request-interceptor posthandler-dofilter. As for the functions are basically the same, the functions that filter can perform, interceptor Both can be executed.
2. What is the computer’s first-level cache and second-level cache?
The main function of the CPU cache is to solve the contradiction between the CPU computing speed and the memory reading and writing speed. That is, the CPU calculation speed is too fast and the memory reading speed is slow, which will cause the memory required for calculation to be read too late and affect the CPU calculation. Therefore, a CPU is needed. Cache, the first-level cache is the CPU cache, which cannot be set. You can only select a different CPU when purchasing. However, the first-level cache of CPUs is almost the same now, and the capacity is relatively small, mostly 64K. Therefore, today’s CPUs rarely mention the first-level cache. The main reason is that everyone is the same. The main job of the first-level cache is to cache instructions. and cache data. The second level cache is between the first level and the memory, generally tens of kilobytes to 1m. The third level cache is only available later. Only 5% of the data in the CPU with the third level cache will be searched in the memory, which greatly improves the CPU calculation. speed. The third-level cache is shared by the CPU. Accessing the first level cache requires 4 clock cycles, the second level requires 10 clock cycles, and the third level requires 39 clock cycles.
3. What are the differences between various database connection pools? How to choose
performance hikariCP>druid>tomcat-jdbc>dbcp>c3p
dbcp does not have the function of automatically recycling idle connections. c3p0 has the function of automatically recycling idle connections. Please refer to the following blog https://blog.csdn.net/vivo_tech/article/details/112985804
4.
What protocols does dubbo have, serialization protocols, and how? select?
By default, 1.dubbo protocol is used, which is implemented based on tcp protocol. Hessian is used as a serialization protocol and can be cross-language. 2. Support http protocol, using json serialization, which is slow. 3. rmi uses java serialization protocol. 4. webservice protocol, uses SOAP text serialization. Please
refer to the following blog
https://www.likecs.com/show-307974978. html
5. What multi-threaded programs have you done? How was it designed?

6.What are the configurations of tomcat? How do you use it?
https://blog.csdn.net/qq_35056891/article/details/131654525
https://blog.csdn.net/lonely_baby/article/details/129272474
7. In addition to tomcat and jboss containers, what are their differences?
http://www.pc-fly.com/a/jisuanjixue/article-249591-1.html
What is the difference between 8.es, mongodb and hbase? How to choose?
https://blog.csdn.net/feiying0canglang/article/details/125896003
9 How to deal with cc attacks?
https://blog.csdn.net/Srsshier/article/details/126921412

Guess you like

Origin blog.csdn.net/qq_34526237/article/details/131778828