Highlights of the most comprehensive ASP. NET interview questions in history (1)

Source: Internet
Author: User

For ASP. NET programmers, there are often some technical problems during interviews. This article collects 130 common ASP. NET interview questions for your reference.

1. Briefly describe the access permissions of private, protected, public, and internal modifiers.
A. private: private Members can be accessed within the class.
Protected: protects members, which can be accessed within the class and in the inheritance class.
Public: A public member. It is completely public and has no access restrictions.
Internal: accessible within the same namespace.

2. List several methods for passing values between ASP. NET pages.
Answer. 1. Use QueryString, such ....? Id = 1; response. Redirect ()....
2. Use Session Variables
3. Use Server. Transfer

3. the rules for a column are as follows: 1, 1, 2, 3, 5, 8, 13, 21, 34 ...... calculate the number of 30th digits and use a recursive algorithm.
A: 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 );
}
}

4. What is the delegate in C? Is an event a delegate?
A:
A delegate can substitute a method as a parameter into another method.
A delegate can be understood as a reference to a function.
Yes, it is a special delegate

5. Differences between override and overload
A:
The difference between override and overload. Overload means that the method name is the same. The parameters or parameter types are different and are reloaded multiple times to meet different needs.
Override is used to Override functions in the base class. To meet your needs.

6. 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?
A:
This. Server. Transfer

7. programmatically traverse all TextBox controls on the page and assign it a string. Empty?
A:
Foreach (System. Windows. Forms. Control control in this. Controls)
{
If (control is System. Windows. Forms. TextBox)
{
System. Windows. Forms. TextBox tb = (System. Windows. Forms. TextBox) control;
Tb. Text = String. Empty;
}
}

8. How can I program a Bubble sorting algorithm?
A:
Int [] array = new int
;
Int temp = 0;
For (int I = 0; I <array. Length-1; I ++)
{
For (int j = I + 1; j <array. Length; j ++)
{
If (array [j] <array [I])
{
Temp = array [I];
Array [I] = array [j];
Array [j] = temp;
}
}
}

9. To describe the implementation process of the indexer in C #, can it be indexed only by numbers?
A: No. Any type can be used.

10. Evaluate the values of the following expressions and write out one or more implementation methods: 1-2 + 3-4 + ...... + M
A:
Int Num = this. TextBox1.Text. ToString ();
Int Sum = 0;
For (int I = 0; I <Num + 1; I ++)
{
If (I % 2) = 1)
{
Sum + = I;
}
Else
{
Sum = Sum-I;
}
}
System. Console. WriteLine (Sum. ToString ());
System. Console. ReadLine ();

11. Use. net for B/S structure. How many layers of structure do you use for development? What is the relationship between each layer and why do you need to layer it like this?
A: Generally, it is three layers.
Data access layer, business layer, and presentation layer.
The data access layer adds, queries, and modifies databases.
The business layer is generally divided into two layers. The business apparent layer communicates with the presentation layer, and the business rule layer Implements user password security.
The presentation layer adds a form to interact with users, for example, users.
Advantages: clear division of labor, clear organization, easy debugging, and scalability.
Disadvantage: increase costs.

12. In the following example
Using System;
Class
{
Public ()
{
PrintFields ();
}
Public virtual void PrintFields (){}
}
Class B:
{
Int x = 1;
Int y;
Public B ()
{
Y =-1;
}
Public override void PrintFields ()
{
Console. WriteLine ("x = {0}, y = {1}", x, y );
}
What is the output when new B () is used to create B's instance?
Answer: X = 1, Y = 0; x = 1 y =-1

13. What is an application domain?
A: The application domain can be considered as a lightweight process. Security. Small resource occupation.

14. What are the explanations of CTS, CLS, and CLR?
A: CTS: a general-purpose language system. CLS: general language specification. CLR: Common Language Runtime Library.

15. What is packing and unpacking?
A: From the value type interface to the Reference Type Packing. Converts a reference type to a value type Unbox.

16. What is regulated code?
A: unsafe: unmanaged code. Does not run through CLR.

17. What is a strong system?
A: RTTI: The type recognition system.

Which classes are required for reading and writing databases in 18.net? What are their roles?
Answer: DataSet: data storage.
DataCommand: Execute the statement command.
DataAdapter: a collection of data.

What are the authentication methods for 19.ASP.net? What are their principles?
Answer: 10. Windwos (default) IIS... From (form) account... Passport (key)

20. What is Code-Behind technology?
A: Code post-planting.

21. In. net, what does the accessory mean?
A: assembly. Intermediate Language, source data, resources, assembly list)

22. What are common WebService call methods?
A: 1.use the wsdl.exe command line tool.
2. Use the Add Web Reference menu option in VS. NET

What is the working principle of 23..net Remoting?
A: the server sends a process number and a program domain number to the client to determine the object location.

24. In C #, use text or images to describe the differences between string str = null and string str =.
A: string str = null indicates that no memory space is allocated to it, while string str = "" indicates that it is allocated with a memory space of a null string.

25. What are the similarities and differences between classes and struct in dotnet?
A: The Class can be instantiated. It belongs to the reference type and is allocated to the memory stack. Struct belongs to the value type and is allocated to the memory stack.


Related Article

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.