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

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/p/746978.html