# 英文算法数据库面试

+关注继续查看

For Chinese applicants, the first step in applying for a visa is to make an appointment by calling 65325305 or 65322228. The problem is that the two numbers are so busy that often they can't get through. Mr Bennett explained: "Since all embassies have to use the 6532 telephone prefix and the number of lines is limited, the US embassy is only allotted two lines for our appointment system. Insgroupsto solve the problem, we plan to work through a contractor. Contractors don't have to use the 6532 prefix, so they can be assigned more lines and hire lots of people to answer calls. Applicants will also be able to use faxes and the Internet to make appointments, which will greatly enhance flexibility and convenience. Since the contract has not been awarded yet, I can't say exactly when the new system will be operative - hopefully sometime in the fall."

1.         判断两个字符串中每个字符的个数是否相等。i.e.

“ABC”, “ACB” return true

“AABC”, “ABCD” return false

2Please write test cases for above as more as possible.

3Give 7 numbers, range from 0-13. The number of 0 is uncertain, other numbers can appear only once. 0 can be converted to any number. Please check whether or not it contains 5 continuous numbers

1,5,2,4,0,13,10  0->3 1,2,3,4,5,10,13 return true

1,5,2,0,0,13,10  0->3 0->4 1,2,3,4,5,10,13 return true

1,5,6,0,0,13,10  return false

4 Please write test cases for above as more as possible.

# SQL Questions:

We need to develop a system for ## University. First we should make a table for teacher with information TeacherID, Address, Salary. Then we need to store courses’ information, e.g.  MajorID, Name, Credit. After that we have to store students’ information, StudentID, Name, and Address.

The ERD is as follow:

Question 1:

Please write a SQL statement which can retrieve the total credit of the students they grant.

Sample output:

StudentID   Name                                               TotalCredit

----------- -------------------------------------------------- -----------

1           Alan Tsui                                          8

2           Ronstar                                            9

3           Steven                                             9

Question 2:

Please write a SQL statement to show which major has the highest PASS rate and which teacher teaches the major. (Hints: get the top 1 major with count (passed student) and then join the teacher table)

Sample output:

TeacherID   TeacherName             MajorID       TotalPass       Name

----------- ----------------------- ------------- -------------- -----------------------

1           Professor Ronstar        2             3              Business Management

10092 0

1552 0
【技术短视频】OceanBase 5mins Tips | 如何合理的选择数据库存储引擎？
4 个技术短视频，带你走进 OceanBase 存储引擎的世界
88 0
MaxCompute数据仓库在更新插入、直接加载、全量历史表三大算法中的数据转换实践
2018“MaxCompute开发者交流”钉钉群直播分享，由阿里云数据技术专家彬甫带来以“MaxCompute数据仓库数据转换实践”为题的演讲。本文首先介绍了MaxCompute的数据架构和流程，其次介绍了ETL算法中的三大算法，即更新插入算法、直接加载算法、全量历史表算法，再次介绍了在OLTP系统中怎样处理NULL值，最后对ETL相关知识进行了详细地介绍。
4753 0

13893 0
6997 0
919 0
+关注

577

0

《2021云上架构与运维峰会演讲合集》

《零基础CSS入门教程》

《零基础HTML入门教程》