C # interview FAQ 2

Source: Internet
Author: User
Tags dot net dot net framework

1. Select fill in blank questions (2 points for each blank question, totally 60 points)
1. Select () when operating the SQL Server database ().
A) SQL Server. NET Framework data provision Program ;
B) OLE DB. NET Framework data provider;
C) ODBC. NET Framework data provider;
D) Oracle. NET Framework data provider;
2. Among the following options, () is the reference type.
A) Enum type
B) struct type
C) string type
D) int type
3. About Code Which of the following statements about the hidden files is true ()
A) the logic of a web form page program consists of Code. The Code is created to interact with the form. The programming logic is unique in a file that is different from the user interface. This file is called a "code hidden" file. If it is created in C #, it will have the ". ascx. cs" extension.
B) The code hidden files on all web forms pages in the project are compiled into. EXE files.
C) The code hidden files of all web forms pages in the project are compiled into the dynamic link library (. dll) file of the project.
D) None of the above are correct.
4. Which of the following statements is false ()
A) abstract classes are supported in C ++ but not in C.
B) In C ++, class members can be declared in header files and class members can be defined in CPP files. in C #, class members are declared and defined at the same place without header files.
C) in C #, you can use the new modifier to explicitly hide the members inherited from the base class.
D) in C #, override must be added before the virtual functions of the base class to be redefined in the derived class.
5. C # data types include ()
A) value type and call type;
B) Value Type and reference type;
C) reference type and link type;
D) link type and call type;
6. Which of the following statements is false ()
A) the class cannot be inherited multiple times, but the interface can;
B) abstract classes can define members, but interfaces cannot;
C) abstract classes and interfaces cannot be instantiated;
D) A class can have multiple base classes and multiple base interfaces;
7. How to load an XML document in the DOM ()
A) Save Method
B) Load Method
C) loadxml Method
D) Send Method
8. Which of the following statements about constructors is true ()
A) constructors can declare the return type.
B) The constructor cannot be modified using private.
C) The constructor must be the same as the class name.
D. The constructor cannot contain parameters.
9. The following are some enumeration definitions in C #. The incorrect usage is ()
A) Public Enum var1 {Mike = 100, Nike = 102, Jike}
B) Public Enum var1 {Mike = 100, Nike, Jike}
C) Public Enum var1 {Mike =-1, Nike, Jike}
D) Public Enum var1 {Mike, Nike, Jike}
10. int [] [] myarray3 = new int [3] [] {New int [3] {5, 6, 2}, new int [5] {6, 9, 7, 8, 3 }, new int [2] {3, 2 }}; the value of myarray3 [2] [2] is ().
A) 9
B) 2
C) 6
D) Cross-border
11. An interface is a reference type. You can declare () in the interface, but cannot declare public domains or private member variables.
A) methods, attributes, indexers, and events;
B) methods, attribute information, and attributes;
C) Indexer and field;
D) Events and fields;
12. In the ASP. NET Framework, server controls are specially designed to work with web forms. There are two types of server controls ()
A) HTML controls and Web controls
B) HTML controls and XML controls
C) XML controls and Web controls
D) HTML controls and IIS controls
13. In ASP. NET, register a user control on the web forms page and specify the control name as "Mike". The correct registration command is ()
A) <% @ register tagprefix = "Mike" tagname = "space2" src = "myx. ascx" %>
B) <% @ register tagprefix = "space2" tagname = "Mike" src = "myx. ascx" %>
C) <% @ register tagprefix = "SpaceX" tagname = "space2" src = "Mike" %>
D) None of the above
14. In ADO. net, the following statements about the executenonquery () method and executereader () method of the command object are false ().
A) SQL statements for insert, update, delete, and other operations are mainly executed using the executenonquery () method;
B) executenonquery () method returns the number of rows affected by SQL statement execution.
C) the SQL statement of the select operation can only be executed by the executereader () method;
D) The executereader () method returns a datareder object;
15. The following ASP. NET Statement (B) correctly creates a connection with the SQL Server 2000 database.
A) sqlconnection con1 = new connection ("Data Source = localhost; Integrated Security = sspi; initial catalog = mydb ");
B) sqlconnection con1 = new sqlconnection ("Data Source = localhost; Integrated Security = sspi; initial catalog = mydb ");
C) sqlconnection con1 = new sqlconnection (Data Source = localhost; Integrated Security = sspi; initial catalog = mydb );
D) sqlconnection con1 = new oledbconnection ("Data Source = localhost; Integrated Security = sspi; initial catalog = mydb ");
16. Which of the following statements about the properties and events of the Toolbar Control in winform is false ().
A) The buttons attribute indicates all toolbar buttons of the Toolbar Control.
B) The buttonsize attribute indicates the size of the toolbar buttons on the toolbar control, such as the height and width.
C) The dropdownarrows attribute indicates whether to display the down arrow keys next to the toolbar button (which has a column value that needs to be displayed in the following PULL mode ).
D) The buttonclick event is triggered when you click anywhere on the toolbar.
17. When executing a stored procedure in ADO. net, if you want to set the output parameters, you must set both the direction and () of the parameters and the parameter size if necessary.
A) size;
B) upper limit;
C) Initial value;
D) type;
18. If you set formboderstyle of the form to none ().
A) The form does not have borders and cannot be adjusted;
B) The form does not have a border but can be adjusted;
C) The form has borders but cannot be adjusted;
D) The form is transparent;
19. If you want to set the form to transparent ()
A) set the formboderstyle attribute to none;
B) set the opacity attribute to a value smaller than 100%;
C) set the locked attribute to true;
D) set the enabled attribute to true;
20. Which of the following statements about the indexer in C # is true ()
A) The index must have two or more parameters.
B) The indexer parameter type must be integer.
C. The indexer has no name.
D) None of the above
21. Which of the following statements is false ().
A) The form is also a control;
B) The form is also a class;
C) controls are inherited from forms;
D) The parent class of the form is the control class;
22. To operate the registry, you must include ().
A) system. componentmodel namespace;
B) system. Collections namespace;
C) system. Threading namespace;
D) Microsoft. Win32 namespace;
23. To create a multi-document application, set the () attribute of the form to true.
A) drawgrid;
B) showintaskbar;
C) enabled;
D) ismdicontainer;
24. If treeview1 = new Treeview () is set, treeview1.nodes. Add ("Root Node") returns a value of the () type.
A) treenode;
B) int;
C) string;
D) Treeview;
25. Which of the following statements about XML is false ().
A) XML provides a method to describe structured data;
B) XML is a simple, platform-independent and widely used standard;
C) XML documents can carry various types of information;
D) XML is only used to generate structured documents;

1. What are the differences between property and attribute in C #? What are their respective uses? What are the advantages of this mechanism?
2. Let's talk about the web service you understand. In the dot NET Framework, how can we combine XML well? (Just talk about the concept)
3. What are the characteristics of C #, Java, and C ++? What are the similarities and differences between C # and Java?
4. C # Can I perform direct operations on the memory? (This is a difficult issue? Note !)
5. How to combine the unmanaged code written in Visual C ++ 6.0 with other dot NET Component in CLR?
6. Some previous projects? Introduce your programming experience. (This is not confusing. It is true or false when you first ask)
7. What do you expect from the company? What are your salary expectations? Why computer science? Previous work experience (which is very important )?

Q3: Maintain database integrity and consistency. Do you like to use triggers or write business logic? Why?
Q4: ADO. What are the main improvements to net over ado?
Q5: Asp. Net compared with ASP, what are the main advances?
Q6: What is the delegate in C? Is an event a delegate?
Q7: describes the implementation process of the indexer in C #. Can indexes be performed only by numbers?
Q8: How does one implement a class that supports foreach traversal in C?
Q10: Write an HTML page to implement the following functions: "Hello" is displayed when you click the page with the left-click button, and "disabled right-click" is displayed when you right-click the page ". The page is automatically closed in 2 minutes.
Q11: Do you know about XMLHTTP and WebService? Briefly describe its features and functions
Q12: What is the difference between an interface and an abstract class? What is the basis for using interfaces and abstract classes?
Q13: What are the similarities and differences between custom controls and general user controls? If you want to use either of the two, which one do you choose? Why?
Q14: Describe ASP. NET Server Control Lifecycle
Q15: UML
Q16: object-oriented concept, Main Features
Q17: basis for classification. Class granularity issues
Q18: Transaction Management Problems

First, let's talk about the differences between final, finally, and finalize.
Second, can anonymous inner class (anonymous internal class) be extends (inherited) other classes, or implements (implemented) interface (Interface )?
Third, the difference between static nested class and inner class is that the more you say, the better (the more general the interview questions are ).
Fourth, the difference between & and.
Fifth, the difference between hashmap and hashtable.
Sixth, the difference between collection and collections.
7. When to use assert.
Eighth, what is GC? Why does GC exist?
Ninth, string S = new string ("XYZ"); how many string objects are created?
10. How much is math. Round (11.5? Math. Round (-11.5) and so on?
11th, short S1 = 1; S1 = S1 + 1; what is the error? Short S1 = 1; S1 + = 1; what is the error?
12th. What is the difference between sleep () and wait?
13th. Does Java have a goto?
14th, does the array have the length () method? Does string have the length () method?
15th, the difference between overload and override. Can the overloaded method change the type of the returned value?
16th. The elements in the set cannot be repeated. How can we identify whether the elements are repeated or not? Is = or equals () used ()? What are their differences?
17th. Give me the most common runtime exception.
18th, what is the difference between error and exception?
19th, list, set, and map are inherited from the collection interface?
20th. What is the difference between abstract class and interface?
21st can abstract methods be both static, native, and synchronized?
22nd. Can an interface inherit an interface? Can an abstract class implement the (implements) interface? Can an abstract class inherit a concrete class )?
23rd. Is run () or start () used to start a thread ()?
24th. Can constructor be overwritten?
25th. Can I inherit the string class?
26th. After a thread enters a synchronized method of an object, can other threads access other methods of this object?
27th, there is a return statement in try {}, so will the code in finally {} following this try be executed? When will it be executed, before or after return?
28th. Programming question: how many equals 2x8 in the most efficient way?
29th, the two objects have the same value (X. Equals (y) = true), but different hash codes are available, right?
30th. After an object is passed as a parameter to a method, this method can change the attributes of the object and return the changed result, so is it a value transfer or a reference transfer?
31st. Does swtich work on byte, long, and string?
32nd programming question: Write a singleton.

Database:

1. Differences between stored procedures and functions
2. What is a transaction?
3. What is the role of a cursor? How do I know that the cursor has reached the end?
4. triggers are divided into pre-trigger and post-trigger. There are differences between these two triggers. What is the difference between statement-level triggering and row-level triggering.

1. Use C # to implement the following functions
A generates an int array with a length of 100 and inserts 1-100 randomly into the array, which cannot be repeated.
B sorts the array generated above, which must be in ascending or descending order.
2. Describes several common methods for passing parameters between pages in. NET and their advantages and disadvantages.
3. Describe the error handling mechanism in. NET and give an example.
4. Please describe the meaning of a strong name
5. List several cycles in C # and point out their differences
6. Indicate all types of base classes in. net
7. Indicate the meaning of GAC
8. In SQL srever, new data is inserted into a table, and how to quickly obtain the current value of the Self-increment Field

Under what circumstances will you use the virtual method? What is the difference between it and the interface?
Q: What is the difference between override and overload?
Q: What is the difference between the value type and the reference type?
Q: How do I understand static variables?
Q: How many requests can be sent to the server?
Q: What is the difference between datareader and dataset?
Q: If you need to pass variable values in a B/S system, but you cannot use session, cookie, and application, how can you handle them?
Q: How many layers of B/S structure do you use. Net for development? What is the relationship between each layer and why do you need to layer it like this?
Q: How many stages are there in the software development process? What is the role of each stage?
Q: Microsoft has launched a series of application blocks. What are the application blocks you know and their functions?
Q: Please list some of the design patterns you have used and when to use them?
Q: What do you know about WebService?
Q: How are you interested in programming? How can I solve problems that I don't understand at work? How do you improve your programming skills?
Q: Why did you leave?
Q: How do I pass Chinese parameters through hyperlinks?
Q: Please program all textbox controls on the page and assign it a string. Empty?
Q: Please program a bubble sort.Algorithm?

1. Differences between override and overload
2. What is the error handling mechanism of. Net?
3. Similarities and Differences between interfaces and classes in C #
4. Differences between datareader and Dataset

1. Which of the following methods can be used to access the member functions and attributes of the other class? For more information, see.
2. If you need to record the number of instances of the class, write a simple class to prove how to implement it.
3. class A is the base class of class B and has its own constructor. For example, we recommend that you describe the execution process of Class B's constructor from Instantiation to extinction.
4. to process a string, remove the spaces at the beginning and end of the string. If there are consecutive spaces in the string, only one space is reserved, that is, multiple spaces are allowed in the string, however, the number of consecutive spaces cannot exceed one.

I. Fill in blank questions
Where is the ternary operator in 1. C __? :___?
2. When integer a is assigned to an object, integer A will be _ packed (encapsulated )___?
3. Which of the following types of Class Members are accessible? This.; new class (). method;
4. Public static const int A = 1; is this Code incorrect? What is it? Const cannot be modified using static
5. Float F =-123.567f;
Int I = (INT) F;
Which of the following is the I value _____? 123
6. I used operator to declare and only declared "=". Is there any error?
7. What is the keyword of the delegate statement ______? Delagete
8. What are the characteristics of classes modified with sealed? Sealed and cannot inherit
9. All Custom User Controls in Asp.net must inherit from ________? Control
10. In. net, all serializable classes are marked _____?
11. In. Net hosting code, we don't have to worry about memory vulnerabilities. This is because ______? GC
12. Are there any errors in the following code? _______
Using system;
Class
{
Public Virtual void F (){
Console. writeline ("a.f ");
}
}
Abstract class B:
{
Public abstract override void F (); // new public abstract void F ();
}

13. when class t only declares the constructor of a private instance, ___ can ___ (can or cannot) derive a new class from T outside the program text of T, it is not allowed to create any instance of t directly (either or not.
14. Is there any error in the following code?
Switch (I ){
Case ():
Casezero ();
Break;
Case 1:
Caseone ();
Break;
Case 2:
Dufault; // wrong
Casetwo ();
Break;
}
15. Can system. Web. UI. Page be inherited in. Net? Yes

Ii. Short answer
1. What are the meanings of using and new keywords in C? Using command and statement new create instance new hide methods in base class
4. What are the differences between classes and structures? The class is a reference type and the structure is a value type.
5. A string of 10000 characters is randomly extracted from a-Z to form a string of 10000 characters. Use C # To write the main program.
6. For such an enumeration type:
Enum color: byte {
Red,
Green,
Blue,
Orange
}
String [] Ss = enum. getnames (typeof (color ));
Byte [] BB = enum. getvalues (typeof (color ));
Test a program to display all the symbol names defined in the enumeration type and their corresponding values.
7. Do you know the design mode? List the names of the design patterns you know. //
8. set a table in SQL Server to save the tree structure of the organization chart (assuming that only the name is required in the structure chart). If I want to query all the positions under a certain position, what are your ideas about using a stored procedure?
9. What is SQL injection and how to prevent it? For example.
10. What is the output of the following code? Why?
Int I = 5;
Int J = 5;
If (object. referenceequals (I, j ))
Console. writeline ("Equal ");
Else
Console. writeline ("not equal ");
// Not equal because the object is compared

1. Write a method to flip a string and add some conditions, such as "," and ".", to design and test its use case.
2. Design a test case for a paper cup (it can be a cup in a broad sense, not necessarily a cup with a specific function)
Development language concepts
3. What is reflection?
4. How to Write Design Patterns with Singleton
5. What is the garbage collection mechanism in C?
6. What is application pool?
7. What are the advantages and disadvantages of the differences between linked lists and arrays.
8. How to Implement remoting on the client server?
9. What is a friend function?
10. How to Implement polymorphism with standard C?
11. What is a virtual function?
12. What is an abstract function?
13. What is memory leakage? How can I determine whether a memory leak is detected in the simplest way?

English
14. The main functions of projects using C #/C ++ are described in English.
15. How do I communicate with American engineers if I want to hold a conference call with the US?
16. What would you do if the boss thinks your technology is lagging behind?

Database knowledge questions
17. Tools used to call stored procedures
18. What are the two indexes of SQL Server? What is the role of an index? What are the advantages and disadvantages of indexes?
19. Functions of triggers

Other knowledge questions and questions
20. What is Web service?
21. What is XML?
22. How to Implement socket?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.