一套.net面试题~ 没有正确答案~ 大家做做看

本文精选了一系列C#及SQL面试题目,涵盖了类继承、集合操作、安全性配置、JavaScript函数执行顺序等知识点,并提供了部分编程实践题供读者练习。

1) What is the highest .NET class that everything is derived from?
A)  System.Data;
B)  System.CodeDom;
C)  System.Object;
D)  System.IO;

2) What is the .NET collection class that allows an element to be accessed
using a unique key?
A)  ArrayList;
B)  Hashtable;
C)  Stack;
D)  Queue;

3) After user has successfully logged in,user information is not stored in:
A)  ViewState
B)  Cookie
C)  Session

4) A structure in C# can be derived from one or more:
A)  classes
B)  interfaces
C)  both
D)  none

5) Which of the following mode is not available for storage in the ASP.NET
   session state?
A)  In-Proc
B)  StateServer
C)  SqlServer
D)  Client-Side

6) How can a web application get configured with the following 
   authorization rules? Anonymous users must not be allowed to access
   the application. All persons except David and John must be allowed
   to access the application.
A)  <authorization>
<deny users = "applicationname\David, applicationname\John" >
<allow roles ="*">
<deny roles = "?">
</authorization>

B)  <authorization>
<deny users = "applicationname\David, applicationname\John" >
<deny users = "?">
<allow users ="*">
    </authorization>

C)  <authorization>
<allow users ="*">
<deny users = "applicationname\David; applicationname\John" >
<deny users = "*">
    </authorization>

D)  <authorization>
<allow users ="*">
<deny users = "applicationname\David, applicationname\John" >
    </authorization>

7) What is the difference between IEnumerator and Enumeration?
A)  IEnumerator is an interface. Enumeration is a datatype.
B)  Both are the same.
C)  IEnumerator is used to define a variable of an Enumeration datatype.

8) What is the fastest way to check whether a string is empty or not in the following code?
A)  bool isEmpty = (str.Length == 0);
B)  bool isEmpty = (str == String.Empty);
C)  bool isEmpty = (str == "");
D)  bool isEmpty = ( str.Equals(""));

9) What is the output for the following code snipet?
A)  112
B)  123
C)  012
D)  122
interface IAddOne
{
int AddOne();
}
struct FixPoint:IAddOne
{
int _x;
public FixPoint( int x )
{
_x = x;
}

public int AddOne()
{
++_x;
return _x;
}
}

ArrayList pointList = new ArrayList(1);
FixPoint f = new FixPoint(0);
pointList.Add( f );

Console.Write( f.AddOne() );
Console.Write( ((IAddOne)pointList[0]).AddOne() );
FixPoint p = (FixPoint)pointList[0];
Console.Write( p.AddOne() );

10) When creating an MDI application, which of the following sentences must be used to mark the form as the parent form?
A)  this.IsMdiContainer = true;
B)  this.MdiParent = this;
C)  this.MdiParent = null;
D)  this.IsMdiContainer = false;


11) There is a table name [Table1] in a database,it contains a varcharcolumn named [Col1] and a datetime column named [Col2],and a str which is a string variable in C# code.  Which Sql is right?
A)  strSql = "select * from [Table1] where [Col1]=" + str + " and 
    [Col2]< getdate()";
B)  strSql = "select * from [Table1] where [Col1]='" + str + "' and
    [Col2]<" + getdate();
C)  strSql = "select * from [Table1] where [Col1]='" + str + "' and
    [Col2]< getdate()";
D)  strSql = "select * from [Table1] where [Col1]= str and [Col2]<
    getdate()";   
12) Evaluate these two SQL statements.  Which statement is the most correct?
SELECT last_name, salary , hire_date
FROM EMPLOYEES
ORDER BY salary DESC;

SELECT last_name, salary, hire_date
FROM EMPLOYEES
ORDER BY 2 DESC;

A)  The two statements produce identical results.
B)  The second statement returns a syntax error.
C)  There is no need to specify DESC because the results are sorted in 
    descending order by default. 
D)  The two statements can be made to produce identical results by
adding a column alias for the salary column in the second SQL
statement.
13) Which function will be run first?
<HTML>
 <HEAD>
  <SCRIPT LANGUAGE="javascript">
  function startSub()
  {
    alert("Script Start!");
  }
  function anotherSub()
  {
    alert("Script Run!");
  }
  function endSub()
  {
    alert("Script End!");
  }
  </SCRIPT>
 </HEAD>
<BODY onLoad = "anotherSub()">
 <script>
  endSub();
 </script>
</BODY>
</HTML>

A)  startSub
B)  endSub
C)  anotherSub
D)  onLoad


14) A java script provides 3 dialog boxes. In which dialog box
    can the operator input text?:  
A)  alert
B)  confirm
C)  prompt
15) What is the result of “s”?
<script language=javascript>
var s = ""
var a = 1;
var b = ++a ;
c = b++ ;
s = a + "," + b + "," + c
</script>

A)  123
B)  223
C)  232
D)  233


Part II
Please choose to answer any two questions out of the following three.
1) Given a relationship EMP(ENO,ENAME,SALARY,DNO)with attributes indicating employee ID, name, salary, and department number, respectively, and a relationship DEPT(DNO,DNAME,MANAGER)with attributes indicating department number, department name and employee ID of department manager, respectively; implement the following functions with SQL statements:

1.The average salary of employees in each department whose salary is not less than 600 yuan.
2.A stored procedure that determines which department an employee works in through the employee’s ID.

 

2) Programming (C#)
1.Implement a Supermarket class to describe a supermarket and compile the following functions: Append() to record existing goods and define goods to be added, Delete() to remove goods, Query() to search for goods and display the result.

2.Define a class Goods with attributes of Name (name of goods), Price (price of goods), and Number (quantity of goods), and actions of Sale (goods selling with prompt for insufficient remain), Add (putting goods on shelf) and ShowMe (displaying information on goods).

3.Write a Main function and test the features above, namely, adding, deleting and querying goods, as well as selling goods and putting goods on shelf.

3) Programming (C#)
public class Compute1

      {

           private double element1,element2;

           public Compute1(double comElement1,double comElement2)

           {

                 this.element1 = comElement1;

                 this.element2 = comElement2;

           }

           public double Add()

           {

                 return element1 + element2;

           }

           public double Subtract()

           {

                 return element1 - element2;

           }

      }

      public interface ICompute

      {

           double ImplyAdd();

           double ImplySubtract();

           double ImplyMultiply();

           double ImplyDiv();

      }

1. Write a class inheritance interface Compute and use the proved methods in Computel.

2. Verify the parameters before you implement ImplyDiv() method.

转载于:https://www.cnblogs.com/RobotTech/archive/2007/05/15/746978.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值