Written test interview useful questions accumulation

Accumulate some interesting topics and learn knowledge points

 

topic

1. How do entity objects perform state migration in Hibernate?
3 states that must be remembered

Transient state (new, or transient), persistent state (managed, or persistent), free state (detached) and removed state (removed, there is no removed state among the three states defined in the previous Hibernate documentation)

save persistence becomes persistent too,
2. What is the N+1 problem of Hibernate and how to solve it?
one more time when querying

n+1 principle explanation and solution

http://www.blogjava.net/RoyPayne/archive/2012/01/30/369017.html
3. What is the mechanism of Hibernate lazy loading and how does it work?
cglib agent loads, executes sql query

http://blog.csdn.net/xc635960736/article/details/7049863

http://superleo.iteye.com/blog/243322
4. How to do Hibernate cascade save?
Setting cascade
5.What is the difference between the second level cache and the first level cache of Hibernate? 
1session 2Other caching frameworks such as ehcache, the session cache cannot be separated from the session

6. About 3 types of read problems, 2 types of update problems and database lock principles in spring

http://www.iteye.com/topic/1124043

 

7. The difference between get and post

  • get is to get data from the server, and post is to send data to the server.
  • On the client side, the Get method submits the data through the URL, and the data can be seen in the URL; the POST method, the data is placed in the HTML HEADER and submitted.
  • The data submitted by GET method can only have a maximum of 2k bytes, while POST does not have this limit.

8. When does spring use require_new

 

9. High performance mysql

 

10. Delete duplicate records in database table

 Use SQL statements to remove duplicates and keep only one
Method 1: Use group by
Among thousands of records, there are some identical records. How can we use SQL statements to delete duplicates?
a. Find redundant duplicate records in the table, duplicate records are judged based on a single field (peopleId) 
select * from people 
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 
b. Delete redundant duplicate records in the table. Duplicate records are judged based on a single field (peopleId), and only the record with the smallest rowid is left. 
delete from people 
where   peopleName in (select peopleName    from people group by peopleName      having count(peopleName) > 1) 
and   peopleId not in (select min(peopleId) from people group by peopleName     having count(peopleName)>1)
Method 2: Use a temporary table
select distinct * into #Tmp_aa from tableName find out the unique ones and insert them into the temporary table
drop table tableName delete the original table
select * into tableName from #Tmp_aa Insert the temporary table into the newly created tableName
drop table #Tmp_aa                                         删掉临时表
 
11.在plsql中如何,从员工表employee中统计出姓王的员工的人数?
直接使用,select count(*) from employee where name like “王%”,可以吗,不可以的话应该怎么做呢
用游标吗,还是说count是分组函数不能这么使用呢?
答:count(*)我在plsql上测试了,跟其他数据mysql是同样的用法,有可能我停Oracle面试时,题目有些听的不够清楚,plsql有空要加强学习
 12.plsql笔试面试题目
 13.spring题目
spring延迟加载,赖加载的属性是:lazy-int=true
spring的单例,多例使用的是scope来配置生命周期
spring隔离级别有4个,还有一个是数据库默认级别isolution-default
读未提交;读提交;可重复读;序列化serializable
一个系统如何判断是否需要延迟加载bean?
14.jvm架构

http://www.cnblogs.com/ggzwtj/archive/2012/04/11/2441724.html

 

15.如何判断链表是否有环的存在

答:

判断链表是否存在环,办法为:
设置两个指针(fast, slow),初始值都指向头,slow每次前进一步,fast每次前进二步,如果链表存在环,则fast必定先进入环,而slow后进入环,两个指针必定相遇。(当然,fast先行头到尾部为NULL,则为无环链表)程序如下:

bool IsExitsLoop(slist *head)
{
    slist *slow = head, *fast = head;

    while ( fast && fast->next ) 
    {
        slow = slow->next;
        fast = fast->next->next; if ( slow == fast ) break;    }    return !(fast == NULL || fast->next == NULL);}
        



 
16. Maven or eclipse export jar , why is the parameter of the method meaningless named, because there is no comment?

 

answer:

Possible reason one:

  When the jar has source code and comments, and the jar 's api is referenced , the parameters will display meaningful names, and comments can also be displayed

  当jar包没有源码时,在生成class文件时,注释会被去掉,方法参数的命名会被简单替换再也没有提示了,所以掉用api时就会出现:既没有注释,方法参数的命名也是param1这种没意义的命名方式

可能原因二:

  eclipse安装了代码混淆工具,所以api的变量名被打乱,无法显示有意义的变量名

  (在APS的开发环境,可能是这张情况引起的)

 

     

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327007693&siteId=291194637