当前位置:网站首页>7.7 sheen Xiyin written test
7.7 sheen Xiyin written test
2022-07-27 02:13:00 【Yu Xiaohe】
Cast Java Engineer position , The question type is 10 Multi channel single selection +5 There are many ways to choose +1 Algorithm questions +1 Avenue sql topic , Duration 1h
choice question
1.spring The propagation characteristics of things , The wrong is :
PROPAGATION_REQUIRED: Support current transaction , If there is no current transaction , Throw an exception .
( Should be : Support current transaction , If there is no current transaction , Just create a new transaction )
PROPAGATION_REQUIRED: Support current transaction , If there is no current transaction , Just create a new transaction .
PROPAGATION_SUPPORTS: Support current transaction , If there is no current transaction , Execute as a non transaction .
PROPAGATION_MANDATORY: Support current transaction , If there is no current transaction , Throw an exception .
PROPAGATION_REQUIRES_NEW: New transaction , If there are currently transactions , Suspend current transaction .
PROPAGATION_NOT_SUPPORTED: Perform operations in a non transactional way , If there are currently transactions , Suspend the current transaction .
PROPAGATION_NEVER: To execute in a non transactional manner , If there are currently transactions , Throw an exception .
2. In the following description of linear linked list , The right is :
When inserting and deleting , There is no need to move the elements in the linked list .
3. The correct description of the following program code is :
class HasStatic{
private static int x = 100;
public static void main(String args[ ]){
HasStatic hs1 = new HasStatic();
hs1.x++;
HasStatic hs2 = new HasStatic();
hs2.x++;
hs1=new HasStatic();
hs1.x++;
HasStatic.x--;
System.out.println( "x=" +x);
}
}

4. The following does not belong to hash The solution to the collision is :
Linear detection 、 Single rotation method 、 Second detection 、 Zipper method
5. The system allocates... To a process 4 Page boxes , The page number sequence accessed by this process is 2,0,2,9,3,4,2,8,2,4,8,4,5. If the page number of the next page visited is 7, basis LRU Algorithm , The page number of the page to be eliminated is :
2
6. process P1 and P2, resources A and B, The process operation on resources is defined as follows : Read resources A:rA; Read resources B:rB; Write resources A:wA; Write resources B:wB. At the same time, it stipulates , Before the process reads a resource , A shared lock must be added , An exclusive lock must be added before writing a resource ; When a resource is shared by a process , It can be shared by other processes , But you can't add an exclusive lock ; Resources are locked exclusively by processes , Other processes cannot be locked . Release the lock after the process completes all operations . process P1 And processes P2 Concurrent execution , Which of the following running sequences may deadlock _____.

Four necessary conditions for deadlock :
Resources are exclusive 、 Inalienable 、 Request and maintain 、 Loop waiting for .
7. Judge var1.intValue() Such output results
8. The following about HTTP/2 The description of is wrong :

D Describe the HTTPS
9. mysql The database has a course selection table learn(student_id int,course_id int), The fields represent student number and course number respectively , Now I want to get the number of courses selected by each student , May I ask the following sql The correct statement is ( )

10. Which of the following data structures is a nonlinear structure ?
The linear table 、 queue 、 Binary tree 、 Stack
11. solve hash Conflicting methods are described incorrectly ?

D

12. About the following code , The following statement is correct : ( )
public class Test {
private synchronized void a() {
}
private void b() {
synchronized (this) {
}
}
private synchronized static void c() {
}
private void d() {
synchronized (Test.class) {
}
}
}

AC
Modify non static methods Locked this object ; Modified static method Locked class object
13. Which of the following sql Statement query can make better use of index
14. Two threads execute the following code concurrently , hypothesis a Global variable , So the following output ___ Which is possible ?
int a=1;
void foo(){
++a;
printf("%d", a);
}32 23 33 22 It's possible

15.JDK17 Which of the following features are included ?
Algorithm problem
String decoding

lc The original title is Auxiliary stack method
class Solution {
public String decodeString(String s) {
StringBuilder res = new StringBuilder();
int multi = 0;
LinkedList<Integer> stack_multi = new LinkedList<>();
LinkedList<String> stack_res = new LinkedList<>();
for(Character c : s.toCharArray()) {
if(c == '[') {
stack_multi.addLast(multi);
stack_res.addLast(res.toString());
multi = 0;
res = new StringBuilder();
}
else if(c == ']') {
StringBuilder tmp = new StringBuilder();
int cur_multi = stack_multi.removeLast();
for(int i = 0; i < cur_multi; i++) tmp.append(res);
res = new StringBuilder(stack_res.removeLast() + tmp);
}
else if(c >= '0' && c <= '9') multi = multi * 10 + Integer.parseInt(c + "");
else res.append(c);
}
return res.toString();
}
}
Mysql
Some question and answer 11 Monthly and daily responses per capita
There is a question and answer creator's answer table answer_tb as follows ( among answer_date Indicates the creation date 、author_id Refers to the creator number 、issue_id Express problem id、char_len Indicates the number of words in the answer ):

Please make statistics 11 Monthly and daily responses per capita ( Number of questions answered / The number of respondents ), Sort by answer date , Two decimal places are reserved for the result , The output of the above example is as follows :


select answer_date,
round(count(issue_id)/count(DISTINCT author_id),2) per_num
from answer_tb
where month(answer_date) = 11
group by answer_date
select answer_date, round(count(*)/count(distinct author_id), 2)
from answer_tb
group by answer_date
order by answer_date;边栏推荐
- 初识C语言(2)
- JS -- first understand the naming rules and data types of JS and variables
- Solution: various error reporting and pit stepping and pit avoiding records encountered in the alchemist cultivation plan pytoch+deeplearning (III)
- Flink1.13.6详细部署方式
- Text to image intensive reading of paper gr-gan: gradually refine text to image generation
- 【mysql】mysql启动关闭命令以及一些报错解决问题
- 超出隐藏显示省略号
- 6.28大华笔试
- Mysql database - interview questions
- [reprint] 6. Tensorrt advanced usage
猜你喜欢

Solution to high collapse

科学计算库 —— Numpy

Unity Huatuo example project source code analysis and inspiration

解决方案:Win10如何使用bash批处理命令

left join 、inner join 、right join区别

MVCC及其原理详解
![[explain C language in detail] this article takes you to know C language and makes you impressed](/img/37/205c1c6eb2ba704941e48ff89c6268.png)
[explain C language in detail] this article takes you to know C language and makes you impressed

Docker advanced: detailed explanation of MySQL master-slave replication and redis cluster capacity expansion and reduction configuration cases

力扣获取第二大的成绩

Flink1.13.6详细部署方式
随机推荐
三种能有效融合文本和图像信息的方法——特征拼接、跨模态注意、条件批量归一化
RIP V2 的简单应用(v2的配置、宣告、手工汇总、RIPV2的认证、沉默接口、加快收敛)
Enumerated valueof() method stepping on the pit
7.16 多益网络笔试
Hash索引和B+树相关知识
Talking about server virtualization & hyper convergence & Storage
[explain C language in detail] this article takes you to know C language and makes you impressed
初识C语言(2)
Mysql database - interview questions
TIM输出比较——PWM
二层封装技术(HDLC、PPP--PAP\CHAP、GRE)实验练习
【数据库课程设计】SQLServer数据库课程设计(学生宿舍管理),课设报告+源码+数据库关系图
事务数据库及其四特性,原理,隔离级别,脏读,幻读,不可重复读?
[reprint] GPU compute capability table
2022年最新文本生成图像研究 开源工作速览(Papers with code)
Introduction to network - Introduction to home networking & basic network knowledge
索引失效原理讲解及其常见情况
初识网页设计
Solution: various error reports and pit stepping and pit avoidance records encountered in the alchemist cultivation plan pytoch+deeplearning (I)
Autojs learning - realize the display of date and lunar time