.NET written test topic [from http:elwin.blogchina.com]

xiaoxiao2021-03-06  14

I have interviewed several companies, and I have done a lot of .NET written test topic, many company's written test questions, it is basically wrong. The full JavaScript, some recruited .NET (C #) programmer did not test any C # knowledge.

I have three principles on my questions: (1) No anything about JavaScript, HTML, CSS. (Perhaps this is some biased, but individuals think that common JavaScript can search on Google, HTML is relatively simple, and interface prototype should be made by art, not what programmers should do.) (2) No Bored concept, such as: What is .NET, What is Webservers, what is ADO, C # is what, what is EJB, what is J2EE, etc. .... (3) Do not have some indiscriminate memories such as: Write a string that connects to SQLServer.

In the pen test, most of them are personal original, and very few procedures are from Java to C # and make modifications. More than 100 people participated in the written test, 55 points to enter the interview, the elimination rate is more than 70%.

http://elwin.blogchina.com

.NET pen test

Name: Date:

1. Fill in the blank: (1) Object-oriented language has ________ 性, ________, ________.

(2) The object that can be used to traverse access to access needs to the _______________________________________.

(3) list five main objects in ADO.NET _______________________________________________________________________.

2. Unscheduled items:

(1) The following narrative is correct:

A. You can have virtual methods in the interface. B. A class can implement multiple interfaces. C. The interface cannot be instantiated. D. The implementation of the implementation can be included in the interface.

(2) Read the record from the database, the methods you may use are:

A. ExecutenonQuery B. ExecuteScalar

C. Fill D. EXECUTEREADER

3. Briefly describe the access rights of private modes of Private, Protected, Public, and Internal.

4. Write a SQL statement: Take out the 31nd to 40th record in Table A (SQLServer, with automatic growth ID as the primary key, note: ID may not be continuous.)

5. Enumerally list several ways to pass the value between the ASP.NET page.

6. Write the output result of the program

Class class1 {private string str = "class1.str"; private int i = 0; static void stringconvert (string stringconvert) {str = "string being control.";} static void stringconvert (class1 c) {C.STR = " STRING BEING CONVERTED. "} static void add (INT i) {i ;} static void addwithref (Ref INT i) {i ;} static void main () {INT I1 = 10; INT I2 = 20; string str =" Str "; class1 c = new class1 (); add (i1); addwithref; add (ci); stringconvert (str); stringconvert (c); console.writeline (i1); console.writeline (i2) Console.writeline (CI); console.writeLine (STR); console.writeline (C.STR);}} 7. Write the output of the program

Public Abstract Class A {public a () {console.writeline ('a');} public virtual void fun () {console.writeline ("a.fun ()");}}

Public Class B: a {public b () {console.writeLine ('b');}

Public new void fun () {console.writeline ("B.Fun ()");}

Public static void main () {a a = new b (); a.fun ();}}

8. Write the output of the program: public class a {public Virtual Void Fun1 (INT i) {console.writeline (i);}

Public void fun2 (a a) {a.fun1 (1); fun1 (5);}}

Public Class B: a {public override void fun1 (INT i) {base.fun1 (i 1);} public static void main () {b = new b (); a a = new a (); a. FUN2 (B); B.FUN2 (a);}}

9. The rules of a column are as follows: 1, 1, 2, 3, 5, 8, 13, 21, 34 ...

Seeking 30th digits, and realizes the recursive algorithm. (C # language)

10. Programming: The cat is called, all the mice began to escape, the owner was awakened. (C # language)

Requirements: 1. There is a linkage, the behavior of mice and the owner is passive.

2. Consider scalability, the call sound of the cat can cause other linkage effects.

Reference answers: 1. (1) inheritance, encapsulation, polymorphism. (Basic Concept) (2) IENUMERABLE, GetENUMERATOR (Understanding of the Foreach mechanism, I don't want to have this question, make a minute) (3) ... (send a partial question, understanding the ADO.NET) rating standard: one 1 point, full of 10 points.

2. (1) B, C (Understanding of the Interface) (2) B, C, D (examined for the proficiency of ADO.NET) Score standard: One question 5 points, no choice or wrong choice. 2 points for leakage. Over 10 points.

3. Private: Private member, can be accessed inside the class. Protected: Protects members, which can be accessed in the internal and inheritance classes. Public members, completely open, no access restrictions. INTERNAL: Access can be accessed in the same namespace. Rating Standard: Answer 1 question 2 points, 2 questions 5 points, 3 questions 7 points. Full-to-10 points. (Send all the questions)

4. Solution 1: SELECT TOP 10 * from a where id not in (SELECT TOP 30 ID from a) Solution 2: SELECT TOP 10 * from a where id> (SELECT TOP 30 ID from A) AS a) Score standard: write pair 10 points. (The answer is not unique, DataGrid page may need to be used) 5. 1. Use queryString, such as ....? ID = 1; response. Redirect () .... 2. Use the session variable 3. Use Server.Transfer. ... rating standard: Answer 1 point 3 points, two 7 minutes, 3:10.

6. (Test value quotation and object reference) 10210strstring being control. Rating standard: Answer 2 points, full range of 10 points.

7. A ba.fun () rating standard: Written A.B 5 points, write A.Fun () 5 points, full range of 10 points. (Check the constructor in inheritance class, as well as the New method,)

8. 2 5 1 6

Score standard: Answer 2 points, two points to get 5 points, 3 points to get 7 points. All 10 points.

(Some people do this question, the head is dizzy .... ^ _ ^)

9.

Public class mainclass {public static void main () {console.writeline (foo (30));} public static int foo (INT i) {if (i <= 0) Return 0; Else IF (i> 0 && i < = 2) RETURN 1; Else Return Foo (i -1) foo (i - 2);}} 评 评 标准 标准: Write Return Foo (I -1) Foo (i - 2); 5 points. Write IF (i> 0 && i <= 2) Return 1; 5 points.

Method parameters require deduction (deduction score = number of parameters - 1)

No recursive algorithm 5 points

(Recursive algorithm is more common in terms of tree structure establishment)

10

Important: 1. Linkage effect, run the code as long as the Cat.cryed () method is executed. 2. Abstract score standards for mice and owners: <1>. Three categories of CAT, MOUSE, MASTER, and make procedures to run (2 points) <2> extract abstract from Mouse and Master (5 points) < 3> Linkage effect, as long as Cat.cryed () can escape the mouse, the owner woke up. (3 points)

Public interface Observer {void response (); // The observer response, such as the mouse to see the cat's reflection} public interface subject {void Aimat (Observer OBS); // What is the observer, here the cat's cat Object --- Mouse} public class mouse: observer {private string name; public mouse (String name, Subject Subj) {this.name = name; subj.Aimat (this);} public void response () {Console.Writeline Name "Attempt to Escape!");}} public class master: Observer {public master (Subject Subj) {Subj.Aimat (this);} public void response () {Console.writeline ("Host Waken!"); }} Public class cat: Subject {private arraylist observers; public cat () {this.observers = new arraylist ();} public void Aimat (OBServer OBS) {this.observers.add (}); Public void cry () {Console.Writeline; Foreach (Observer Obs in this.observers) {obs.response ();}}} class mainclass}}} class mainclass}}} class mainclass {static void main (string [] args) {cat Cat = new cat (); mouse mouse1 = new mouse ("mouse1", cat); mouse mouse2 = new mouse ("mouse2", cat); master master = new master (cat); Cat.cry ();}} / / -------------------------------------------------------------------------------------------- ---------------------------------------------

Design Method two: Use event - delegate design .. public delegate void SubEventHandler (); public abstract class Subject {public event SubEventHandler SubEvent; protected void FireAway () {if (this.SubEvent = null!) This.SubEvent (); }}} Public class cat: Subject {public void cry ("CAT Cryed."); This.fireaway ();}} public abstract class observer {public observer (Subject Sub) {sub.suBevent = new SubEventHandler (Response);} public abstract void Response ();} public class Mouse: Observer {private string name; public Mouse (string name, Subject sub): base (sub) {this.name = name;} public override void Response () {console.writeline (Name "Attempt to Escape!");}} Public class master: Observer {public master Subject Sub): Base (SUB) {} public override void response () {console.writeline ("host waken");}} class class1 {static void main (string [] args) {cat cat = new cat (); Mouse mouse1 = new mouse ("Mouse1", CAT); mouse mouse2 = new mouse ("mouse2", cat); master master = new master (cat); Cat.cry ();}}

转载请注明原文地址:https://www.9cbs.com/read-47915.html

New Post(0)