当前位置:网站首页>Interview pit summary I
Interview pit summary I
2022-06-26 15:47:00 【YMY_ six hundred and sixty-six】
JVM Will two objects in the reference be recycled ?
Can't , Strongly referenced objects are not recycled
hashMap Why rewrite hashcode and .equals Method ?
It should be a static inner class Node Rewrote , For comparison key,value Decide whether to replace or append in the form of a linked list
rabbitmq If an exception occurs during message listening, how can I return to the queue and keep blocking ?
Return to the team and be consumed by other consumers
@Controller What does the annotation return ?
Return the template engine view name
@Component Annotations marked on interfaces or abstract classes can create injections bean Do you ?
You can't , Interface cannot be instantiated
spring How to inject mybatis Of mapper Interface ?
mybatis There is one MapperFactoryBean Class implements the spring Of FactoryBean Interface implements its getObject Method ,
Realized FactoryBean Interface bean It's a factory bean, factory bean Realized getObject The object returned by the method can be Autowired and Resource Inject
mysql What is the difference between a primary key index and a normal index ?
Clustered index and general index , Cluster index at B+ The leaf node of the tree , The normal index is located in B+ The non leaf node of a tree
1, The primary key index indexes the data , Then the ordinary index indexes the primary key ID value ( This is innodb in , But if it is myisam in , There is no difference between a primary key index and an ordinary index. They index data directly )
2, When you query with where id=x when , You only need to scan the primary key index once , Then get the corresponding data
But if it is a normal index for query , Then we will scan the ordinary index first , Get the primary key value , Then scan the primary key index , Get the data you need , This process is called back to table
spring When a declarative transaction will fail ?
@Transactional Apply to non public The way to decorate
@Transactional Annotation Properties propagation Setting error
@Transactional Annotation Properties rollbackFor Setting error
Method calls in the same class , Lead to @Transactional invalid ( For example, there is a class Test, One way of it A,A Call the methods of this class B( No matter how B Yes, it is public still private modification ), But the way A There is no declaration to annotate the transaction , and B There are methods . Then the external call method A after , Method B It doesn't work .)
In the program try/catch Exception handled
The database engine does not support transactions
spring Is there any other way to solve circular dependency besides L3 cache ?
RPC and RMI The difference between ?
RPC Is a remote procedure call ,RMI It's different JVM Object sharing between
spring bean Life cycle
spring bean The life cycle flow of the container is as follows :
1、Spring The container depends on bean Instantiate in definition bean.
2、Spring Fill all properties with dependency injection , Such as bean Configuration defined in .
3、 If bean Realization BeanNameAware Interface , Then the factory passes bean Of ID To call setBeanName().
4、 If bean Realization BeanFactoryAware Interface , The factory calls... By passing its own instance setBeanFactory().
5、 If it exists with bean Anything connected BeanPostProcessors, Call preProcessBeforeInitialization() Method .
6、 If bean It specifies init Method ( Of init-method attribute ), Then it will be called .
7、 Last , If it exists with bean Anything connected BeanPostProcessors, Will call postProcessAfterInitialization() Method .
8、 If bean Realization DisposableBean Interface , When spring When container is closed , Would call destory().
9、 If bean It specifies destroy Method ( Of destroy-method attribute ), Then it will be called
mysql How to start a slow query ?
slow_query_log Slow query on state
slow_query_log_file Slow query log storage location ( This directory needs MySQL The writable permission of the running account , Generally set as MySQL Data storage directory )
long_query_time How many seconds does the query take to record
The difference between filter interceptors ?
The underlying implementation principles are different , Filters are based on function callbacks , Interceptors are implemented by dynamic agents .
filter What we achieve is javax.servlet.Filter Interface , And this interface is in the Servlet As defined in the specification , Filter dependency servlet, That is to say, the filter Filter The use of Tomcat Equal container , It can only be found in web Used in program .
And the interceptor is spring A component of .
filter Filter After the request enters the container , But in entering servlet Pre treatment before , The request ends at servlet After processing .
Interceptor Interceptor It's asking for access servlet after , When entering Controller What was pretreated before .
For filter @Order Annotations control the execution order , adopt @Order Controls the level of the filter , The smaller the value, the higher the level, the earlier execution .
When configuring custom Filter when , If you don't specify order( If not specified, it defaults to Integer.MIN_VALUE),init() The execution order is random , but doFilter() Press filter The lexicographic order of the name is executed ;
Interceptor default execution order , It's the registration order , It can also be done through .order() Method to set the control manually , The smaller the value, the earlier to execute .
mysql What will not hit the index ?
The index specification is unreasonable ,sql The parser did not hit the index .
An index in a table is an index based on the largest number of data fields in the table ,sql The parser did not hit the index .( In fact, the index is useless , Finally, the global search )
bool Index the fields of ,sql Selector misses index .
Fuzzy query %like
The index column participates in the calculation , Using functions
Non leftmost prefix order
where Yes null Judge
where It's not equal to
or Operation has at least one field without index
The query result set that needs to be returned to the table is too large ( Beyond the scope of the configuration )
边栏推荐
- PCIe Capabilities List
- [tcapulusdb knowledge base] tcapulusdb system user group introduction
- How do I open an account on my mobile phone? Is online account opening safe?
- NFT transaction principle analysis (1)
- 音视频学习(二)——帧率、码流和分辨率
- /etc/profile、/etc/bashrc、~/. Bashrc differences
- 【SNMP】snmp trap 介绍、安装、命令|Trap的发送与接收代码实现
- CNN优化trick
- Audio and video learning (III) -- SIP protocol
- js创意图标导航菜单切换背景色
猜你喜欢

全面解析Discord安全问题

还存在过有键盘的kindle?

NFT 平台安全指南(2)

PCIe Capabilities List

Summary of students' learning career (2022)

Utilisation d'abortcontroller

音视频学习(一)——PTZ控制原理
![[CEPH] cephfs internal implementation (I): Concept -- undigested](/img/5c/ca666118848b4f3042b834fb79d27f.png)
[CEPH] cephfs internal implementation (I): Concept -- undigested

【ceph】CEPHFS 内部实现(一):概念篇--未消化

【文件】VFS四大struct:file、dentry、inode、super_block 是什么?区别?关系?--编辑中
随机推荐
JS之简易deepCopy(简介递归)
【leetcode】331. Verifying the preorder serialization of a binary tree
学习内存屏障
svg上升的彩色气泡动画
为什么图像分割任务中经常用到编码器和解码器结构?
HW安全响应
[CEPH] Introduction to cephfs caps
5000字解析:实战化场景下的容器安全攻防之道
音视频学习(一)——PTZ控制原理
【ceph】cephfs的锁 笔记
【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
Inaccurate data accuracy in ETL process
零知识 QAP 问题的转化
When a project with cmake is cross compiled to a link, an error cannot be found So dynamic library file
El dialog drag and drop, the boundary problem is completely corrected, and the bug of the online version is fixed
JVM笔记
AbortController的使用
Application of ansible automation
Audio and video learning (II) -- frame rate, code stream and resolution
[wechat applet] event binding, do you understand?