当前位置:网站首页>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 )
边栏推荐
- Unable to download Plug-in after idea local agent
- Super double efficiency! Pycharm ten tips
- 【leetcode】701. Insert operation in binary search tree
- Beijing Fangshan District specialized special new small giant enterprise recognition conditions, with a subsidy of 500000 yuan
- svg上升的彩色气泡动画
- JVM笔记
- AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy
- [tcapulusdb knowledge base] Introduction to tcapulusdb data structure
- Evaluate:huggingface detailed introduction to the evaluation index module
- 【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
猜你喜欢
【ceph】mkdir|mksnap流程源码分析|锁状态切换实例
Analyse panoramique de la chaîne industrielle en amont, en aval et en aval de la NFT « Dry goods»
Vsomeip3 dual computer communication file configuration
[CEPH] cephfs internal implementation (II): example -- undigested
全面解析Discord安全问题
Use of abortcontroller
NFT 平台安全指南(2)
评价——TOPSIS
[tcapulusdb knowledge base] Introduction to tcapulusdb data structure
「干货」NFT 上中下游产业链全景分析
随机推荐
AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy
面试踩坑总结一
Comparative analysis of restcloud ETL and kettle
/etc/profile、/etc/bashrc、~/.bashrc的区别
NFT交易原理分析(1)
[CEPH] cephfs internal implementation (I): Concept -- undigested
NFT 项目的开发、部署、上线的流程(1)
[applet practice series] Introduction to the registration life cycle of the applet framework page
【ceph】CEPHFS 内部实现(一):概念篇--未消化
[tcapulusdb knowledge base] tcapulusdb system user group introduction
sqlite加载csv文件,并做数据分析
【leetcode】701. Insert operation in binary search tree
在哪个平台买股票开户安全?求指导
音视频学习(三)——sip协议
5000字解析:实战化场景下的容器安全攻防之道
【ceph】CephFS 内部实现(二):示例--未消化
[CEPH] cephfs internal implementation (IV): how is MDS started-- Undigested
Utilisation d'abortcontroller
【文件】VFS四大struct:file、dentry、inode、super_block 是什么?区别?关系?--编辑中
[CEPH] Lock Notes of cephfs