面试者自述

本文涉及的产品
RDS SQL Server Serverless,2-4RCU 50GB 3个月
推荐场景:
云数据库 RDS SQL Server,基础系列 2核4GB
简介: You should answer 7 optional questions plus all 3 required questions. SQL (Required): 1.

You should answer 7 optional questions plus all 3 required questions.

SQL (Required):

1.    Table: Student (Student ID, Student Name)

                        Lesson (Lessoned, LessonName, StudentID)

 There are students without Lesson information.

 Please write Sql script to create table and get all students and their lesson information.

CREATE TABLE [dbo].[Student] (

       [StudentID] [varchar] (50)  AS NOT NULL ,

       [StudentName] [varchar] (50)  AS NOT NULL

) ON [PRIMARY]

GO

 

Select Student.*, Lesson.* from Student inner join Lesson ON Student.StudentID= Lesson. LessonID

 

2.    Please list out the difference between Cluster index and Non-cluster index.

聚簇索引是跟数据的物理排列顺序相关的,所以查询起来效率相对高一些,找到了索引值,也就找到了这个数据,非聚簇索引可以理解为数据的逻辑存储相关,找到了非聚簇索引,不一定找到了这个数据,因为它不包含实际的数据,所以效率相对低一些。

 

3.     How to get the last day of a month using Sql script from any given date?

              Declare @year (int)

              Declare @month (int)

              Declare @day (int)

              Declare @newDate (varchar20)

              Declare @nextMonth (int)

              Declare @endDate (DateTime)

             

              @year=YEAR(@givenDate)

              @month=MONTH(@givenDate)

              @day=DAY(@givenDate)

              @nextMonth=@month+1

              @endDate=

              @newDate=DATEDIFF(@givenDate,@endDate)

              @day=@newDate+@day

              Print @day

             

 

General Questions (optional)

1.      Does C# support multiple-inheritance?

     C#不支持多重继承

2.      Who is a protected class-level variable available to?

只有继承了该类的子类才能具有可用的权限。

3.      Are private class-level variables inherited?
           private变量不能被继承的。

4.      Describe the accessibility modifier “protected internal”.

      在一个程序集中具有继承关系的类之间可以具有访问性

5.      What’s the top .NET class that everything is derived from?

     System.Object

6.      What does the term immutable mean?

 

7.      What’s the difference between System.String and System.Text.StringBuilder classes?

       String 是恒定变量字符串,当重新赋值或追加值时候,需要重新分配空间,

    stringBuilder不是恒定变量,是可变变量,追加赋值的时候不需要重新分配空间。

 8.      What’s the advantage of using System.Text.StringBuilder over System.String?

在进行大量的字符串处理操作时候stringBuilder效率和性能会很高,不需要分配太多的空间

9.      Can you store multiple data types in System.Array? 

  不能

10.  What’s the difference between the System.Array.CopyTo() and System.Array.Clone()? 

      copyTo()方法是拷贝元素到另一个存在的数组里面,是元素值的拷贝;而clone()方法是对象的克隆技术来实现,有浅拷贝和深拷贝,浅拷贝是:返回一个新的对象,该对象包含了所有原始对象的元素,深拷贝是:拷贝引用,可以看作是为每个元素都创建一个引用实例,然后拷贝值。

11.  How can you sort the elements of the array in descending order? 

      调用sort()方法,然后调用Reverse()倒叙。

12.  What’s the .NET collection class that allows an element to be accessed using a unique key? 

      HashTable.

13.  What class is underneath the SortedList class? 

      A sorted HashTable.

14.  Will the finally block get executed if an exception has not occurred? ­ 

Finally块会执行的。

15.  What’s the C# syntax to catch any possible exception? 

      Catch(Exception ex)捕获System.Expection类型任何可能的异常。

16.  Can multiple catch blocks be executed for a single try statement? 

不能捕获,只能捕获跟try块相匹配的异常,如果没有找到,则CLR会沿着调用栈向更高一层搜索能够接受该异常的捕获块。

17.   Explain the three services model commonly know as a three-tier application. 

UI  Business Logic  DataAccess 层层之间实现松散的耦合关系,通过相关的设计模式实现依赖注入、动态绑定等来提高架构的灵活性和高维护性。

 

Class Questions (optional)

1.      What is the syntax to inherit from a class in C#?

  public class1 : BaseClass,使用“:”来实现。

  1. Can you prevent your class from being inherited by another class?
  2.   Yes “sealed” keyword

可以将方法和类标记成sealed

3.      Can you allow a class to be inherited, but prevent the method from being over-ridden? 

      方法不要定义成:virtual就可以了。

4.      What’s an abstract class? 

      具有抽象方法的,可以被其他类继承的通用性的类,不能被实例化的,可以理解为具有架构和蓝图性的类,可以定义成抽象类。

5.      When do you absolutely have to declare a class as abstract? 

      这个类具有被继承类的一些通用特征,至少有一个方法定义成抽象的, 6.      What is an interface class? 

      用来实现多重继承,具有一些属性、方法和事件等特性,不像类,接口是没有实现的,只是实现了类之间的一个契约。说明这个类能够做什么。

7.      Why can’t you specify the accessibility modifier for methods inside the interface? 

      接口是用来定义类之间的的一个协定,所以必须定义为public,以便类和类之间的通信。 默认是public

8.      Can you inherit multiple interfaces? 

      是的,可以继承多重接口

9.      What happens if you inherit multiple interfaces and they have conflicting method names?

      显式的实现接口的方法调用方法。

      (Interface1)Interface1.Method ()

      (Interface2)Interface2.Method ()

 

10.  What’s the difference between an interface and abstract class? 

      表面上,接口是用来实现多重继承的,接口中的方法是没有实现的,抽象类中的方法只要不是定义成抽象方法,是可以有方法的实现的。本质上,接口定义了类之间的协定,说明了这个类能够做什么,而抽象类是定义了类的一些本质的特性,一些通用的性的蓝图性的特性。

11.   What is the difference between a Struct and a Class? 

Struct 是个值类型,不能被继承,Class是个引用类型,可以被继承。 Struct是在线程堆栈上分配的,不受垃圾回收机制控制,class是在托管堆上分配的,收垃圾回收机制控制。

Method and Property Questions (optional)

1.      What’s the implicit name of the parameter that gets passed into the set method/property of a class?

  value关键字是get/set操作的一个隐含的参数。

2.      What does the keyword “virtual” declare for a method or property?

  这个方法被定义成virtual后,继承这个类的的子类,可以重写这个方法,具有重写这个方法的权利。

  1. How is method overriding different from method overloading?
    overriding是重写这个方法,如上面描述的,重写父类被定义成virtual的方法。

Overloading是重载这个方法,方法名称是不变的,可以是改变这个方法的参数类型,增加方法的参数等,以来实现一个方法具有不同的功能,改变方法的行为,封装好了接受调用。

4.      Can you declare an override method to be static if the original method is not static?

  不能的,虚方法的版本要同步。

5.      What are the different ways a method can be overloaded?
           函数名称相同,参数类型可以不同,参数个数可以不同,参数顺序可以不同。

6.      If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?

可以的,使用“:”

关键字是基于(参数列表调用适当的构造函数)在被继承类中定义的重载构造函。

 

Events and Delegates (optional)

1.      What’s a delegate?

  delegate就是委托,是函数指针的概念。在事件编程中提供回调函数机制。

2.             What’s a multicast delegate?

  一个delegate可以触发多个函数被调用

 

Debugging and Testing Questions (optional)

1.        What debugging tools come with the .NET SDK? 

DbgCLRVisual Studio 使用的

2.      What does assert () method do?

  断言和断言方法是用来验证自己写的代码是否满足需要的功能,断言为真的时候,说明程序运行正常,没有什么问题,如果为假,证明程序发生意料之外的错误。

  1. What’s the difference between the Debug class and Trace class?

Debug class是需要Debug Builds Trace class 需要debug和释放builds

 

4.     Why are there five tracing levels in System.Diagnostics.TraceSwitcher?

 

5.      Where is the output of TextWriterTraceListener redirected?

 

6.      How do you debug an ASP.NET Web application?

      通过aspnet_wp.exe进程,可以设置断点,单布跟踪,看堆栈调用情况,值的变化情况。

 

7.      What are three test cases you should go through in unit testing?

 1、积极的正确的测试用例Positive test cases(正确的数据输入,正确的输出)

2、消极的测试用例Negative test cases(错误的数据,看是否有错误的输出,是否有出错处理等)

3、例外的测试用例Exception test cases (异常被捕获,并处理了异常等). 

8.      Can you change the value of a variable while debugging a C# application?

  可以,如果用Visual Studio来调试,可以使用窗口来查看和改变值。

 

ADO.NET and Database Questions (optional)

1.        What is the role of the DataReader class in ADO.NET connections?

  数据阅读器,获取一个数据阅读器记录集,提供只向前读和只读的的功能,对于简单的读取数据来说,性能较高,是基于连接的,所以读完以后需要手动的关闭。

2.      What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?

.NET框架附带了两个.NET数据提供程序:SQLServer.NET数据提供程序和OLEDB.NET数据提供程序。SQLServer.NET数据提供程序是高速的和高性能的,但是需要SQL Server许可来从OLEDB.NET获取,但相对OLEDB.NET会快很多

 

3.      What is the wildcard character in SQL?

 确定特定字符串是否与指定模式相匹配,like '%"+L +"%, _(下划线),[ ].

4.      Explain ACID rule of thumb for transactions. 

事务必须是

1)原子级的;

2)具有一致性的,定义事务必须保持数据一致;

3)具有隔离性的,一个事务是必须独立于其他事务的;

4)具有持久性的,一个事务完成后,它的影响永久地保留在数据库中了。

5.      What connections does Microsoft SQL Server support?

Windows 验证 ( Active Directory) SQL Server 验证 (Microsoft SQL Server username and password). 

6.      Between Windows Authentication and SQL Server Authentication, which one is trusted and which one is untrusted?

 Windows验证具有更高的可信任性,SQL Server验证是不太可信任的, Windows验证是通过Active Directory来验证用户名和密码,

 

7.   What does the Initial Catalog parameter define in the connection string?

databaseName(数据库名称),详细如下:

  Initial Catalog=databaseName;User ID=UserName;Password=password

8.      What does the Dispose method do with the connection object?

  用来释放一些非托管资源的。关闭一个连接,释放一个连接到连接池中。

9.             What is a pre-requisite for connection pooling?

 连接池的大小,同一时间允许共享的连接数,安全设置等一些属性。

 

Assembly Questions (optional)

1.        How is the DLL Hell problem solved in .NET?

将类型生成模块,然后将模块组合成程序集,这些程序集能够重用的、具有版本控制和实施安全策略的单元。

2.      What is a satellite assembly?

 具有特定语言文化资源的程序集为卫星程序集,该程序集反映了其中的一些语言文化特性。

3.      What namespaces are necessary to create a localized application?

 System.Globalization System.Resources

4.      What is the smallest unit of execution in .NET?

  应用程序域是.net一个执行单元,应用程序域中加载相应的程序集。

5.      Whet is the garbage collector  in Net. When should you call the garbage collector in .NET? 

      GC.NET中垃圾回收器,当分配在托管堆中的对象将托管堆内存空间占用满了,垃圾回收器就开始工作了,它是个多线程的。

6.      How do you convert a value-type to a reference-type? 

      显式类型转换,隐式类型转换,存在装箱的操作,

      Int i=10;

      Object o=i;

      i=(int)o

7.      What happens in memory when you Box and Unbox a value-type?

      当存在装箱时候,内存托管堆要分配空间,分配引用类型的指针,然后进行值的一个拷贝,

      当存在拆箱操作的时候,线程堆栈上要进行分配空间,然后进行值的拷贝,然后垃圾回收器来进行回收无用的对象引用。

面试者:

1.       给定一个字符串(包含有空格,数字,控制符等),求其中单词的个数;

2.       给定一个字符串,将其内容反转,并写出测试用例;

 

 总结:

1.       C语言和数据结构、算法等有较高的要求;

2.       白板代码书写能力。

 

 

 

 

相关实践学习
使用SQL语句管理索引
本次实验主要介绍如何在RDS-SQLServer数据库中,使用SQL语句管理索引。
SQL Server on Linux入门教程
SQL Server数据库一直只提供Windows下的版本。2016年微软宣布推出可运行在Linux系统下的SQL Server数据库,该版本目前还是早期预览版本。本课程主要介绍SQLServer On Linux的基本知识。 相关的阿里云产品:云数据库RDS SQL Server版 RDS SQL Server不仅拥有高可用架构和任意时间点的数据恢复功能,强力支撑各种企业应用,同时也包含了微软的License费用,减少额外支出。 了解产品详情: https://www.aliyun.com/product/rds/sqlserver
相关文章
复习这份美团架构师的Java核心面试宝典,我四面阿里拿下offer
怎样才能拿到大厂的offer,没有掌握绝对的技术,那么就要不断的学习 他是如何拿下阿里等大厂的offer的呢,今天分享他的秘密武器,美团资深架构师整理的Java核心知识点,面试时面试官必问的知识点,篇章包括了很多知识点,其中包括了有基础知识、Java集合、JVM、多线程并发、spring原理、微服务、Netty 与RPC 、Kafka、日记、设计模式、Java算法、数据库、Zookeeper、分布式缓存、数据结构等等。
简历面试 | 不会讲故事的人到底有多吃亏
职场中很多人都是做事靠谱,表达翻车,明明做了80分,却连60分都讲不出来,真的非常吃亏。尤其在写简历和面试场景,面试官很难通过实实在在的相处和观察,得知你究竟工作结果如何,只能通过文字和语言描述判断你的能力。这篇文章会具体讲一讲,如何描述自己的经历会更有说服力。
84675 23
简历面试 | 不会讲故事的人到底有多吃亏
“2023金三银四”又来了,关于面试,你需要知道的这些事
没有跳不了的槽,只有没用心的人,2023最新后端岗位面试真题+简历包装。
133 0
“2023金三银四”又来了,关于面试,你需要知道的这些事
裁员下的面试回顾(2022年的第二篇总结)
闲谈 年初的时候给自己定了个计划,就是每隔两个月左右写篇总结记录自己的工作或者生活。因为这几个月基本上都在忙着复习和面试,所以不知不觉就到了5月底。 裁员两个字不是为了吸引眼球,也不是说自己被裁了,而是切切实实地感受到了裁员背景下找工作比以往更不容易。往年自己都是在职准备两周左右就出去外面面试了,基本上面个十家左右就可以敲定入职下家。而今年在面了20多家后,仍然没有收到满意的offer,所以就觉得比之前难度提升了很多。在面试的时候也可以感受到,很多公司虽然技术面上没有出现什么卡壳,但是由于简历对比,背景和项目经验对比,还是会被淘汰。
应届生该如何准备面试,我有话想说。
面试的前提准备包含5~6个方面:简历编写、项目经验、技术能力、简历投递(牛客网、脉脉、智联招聘、BOSS直聘)、面试准备、算法准备等等内容。 面试过程包含内容:一般分为2~3轮技术面试+1轮HR面试,1轮技术面试又包含了基础知识和业务逻辑面试和算法面试(中大厂必备)。 基础知识面试:对专业知识是否掌握,掌握的熟练度又是几成。比如学校学习的操作系统、计算机组成原理、计算机网络、数据结构、数据库甚是前端相关知识都可以考察。 业务逻辑面试:对简历上的项目考察,面试官根据项目的内容进行考察,比如项目某个功能为什么要这么做?优缺点分析,假如重新让你再做一次,你会怎么做。。。然后会针对你所做的东西进行深度
234 2
应届生该如何准备面试,我有话想说。
给在校准备找工作的同学的几个建议
Vim 被誉为"编辑器之神",这可不是虚的。
133 0
面试宝典(一) - 让你不再错过“金九银十“的求职浪潮之简历包装篇
面试宝典(一) - 让你不再错过“金九银十“的求职浪潮之简历包装篇
157 0
面试宝典(一) - 让你不再错过“金九银十“的求职浪潮之简历包装篇
简历面试 | #不会讲故事#的人到底有多吃亏#
职场中很多人都是做事靠谱,表达翻车,明明做了80分,却连60分都讲不出来,真的非常吃亏。尤其在写简历和面试场景,面试官很难通过实实在在的相处和观察,得知你究竟工作结果如何,只能通过文字和语言描述判断你的能力。这篇文章会具体讲一讲,如何描述自己的经历会更有说服力。
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等