Asp. net interview questions and asp.net interview

Source: Internet
Author: User

Asp. net interview questions and asp.net interview

1. Differences between ref and out

2. Three a labels have no id, no name, and no class. How to select the second a label and use jquert to select

<A href = "# This is the first" </a> <a href = "# This is the second"> </a> <a href = "# This is the third"> </a> <script> $ (function) {$ ("a: eq (1 )"). attr ("href") ;}</script>View Code

 

3. What is the difference between a set, a generic set, and an array?

4. What is the difference between string and stringbuilder?

The string object cannot be changed. Every time you use the string class, you must create a new string object in the memory, which requires a new space for the object, stringbuilder modifies the original string during string connection operations, improving performance!

To put it simply, string cannot be longer, and stringbuilder can be longer.

5. What is the difference between webapi, webservice, and wcf? Why webapi

6. code optimization

7. How to optimize databases and optimize queries?

8. What if two people operate a piece of data at the same time?

9. Does the cache know? How to use it?

Cache is a technology that exchanges space for time. In other words, it stores your data in the memory for a period of time, in this short period of time, the server does not read the database or the real data source, but reads the data you store in the memory.

The cache in asp.net is mainly divided into three types: Page cache, data source cache, and custom data cache.

Data Cache: adds time-consuming entries to an object cache set and stores them as key values. We can useCache.Insert()To set cache expiration, priority, and dependencies.

Specific implementation reference http://www.cnblogs.com/knowledgesea/archive/2012/06/20/2536603.html

10. How does one handle global exceptions? How did you capture it?

Handle exceptions through the webconfig customErrors Node

<System. web> <! -- Add customErrors node definition 404 jump page --> <customErrors mode = "On"> <error statusCode = "404" redirect = "/Error/Path404"/> </customErrors> </system. web>View Code

Methods for capturing exceptions

1. Capture unprocessed exceptions using HttpModule [recommended]

2. Capture unprocessed exceptions in Global 3. Page-level exception capture

Specific code reference http://www.cnblogs.com/youring2/archive/2012/04/25/2469974.html

11. How do I know if I have logged on to this user?

Logic for verifying whether a user logs on: 1) Remember the session in the background req when logging on with the user's password.

2) If the user saves the login password, remember the cookie; otherwise, set the current user's cookie to NULL;

3) each time a user needs to send a request to the background, the status should be checked:

Does the session exist? If yes, the request continues and the validity period of the session is reset;

If the cookie does not exist, check whether the cookie exists? If this cookie exists, automatic logon is completed. 1 );

If not, the page is redirected to the logon page.

A simple answer: You can use the Session to determine, because in general, you need to store the login information of each user in the Session.
As long as the Session value is null or has expired, it can be said that the user has exited !!

12. What is reflection? Applications in projects?

Reflection is to dynamically obtain the assembly.

Reflection: Reflection
1) when the base class calls the derived class, use
2) at runtime, the system determines the class to be called.
3) obtain information about the modular assembly class constructor attribute methods and instantiate classes at runtime,
Call constructors, attributes, methods, events, delegates, and so on ...... After dynamic instantiation of types, you can also use reflection to perform operations on them.
4) if you can determine the class to be called when writing code, you can call it directly.
However, in many cases (maybe for universality), the type to be called must be determined at runtime, so reflection is necessary to obtain information about the type.

In simple terms, it is something that can be done at runtime with a string. It is actually a universal factory built in. net framework.

13. How to deal with high concurrency?

 

14. What is npoi? If any

With NPOI, you can read and write WORD/EXCEL documents on a machine without an Office or corresponding environment.NPOIIs built onPOI 3.xVersion above, it can be installedOfficeIn the caseWord/ExcelDocumentation for read/write operations.

(2) Use NPOIAdvantages 1. You can use this framework for free. 2. It includes most EXCEL features (cell style, data format, formulas, and so on) 3. Professional Technical Support Service (24x7 around the clock) (not free) 4. Supported file formats include xls, xlsx, and docx. 5. Adopt an interface-oriented design architecture (you can view NPOI. SS namespace) 6. Supports file Import and Export 7. Based on. net 2.0 also supports the xlsx and docx formats (of course also supports. net 4.0) 8. A large number of successful and real tests from around the world, Cases 9, a large number of instance Code 11, you do not need to install Microsoft's OfficeTo avoid copyright issues. 12. usage ratio Office PIAOf APIMore convenient and user-friendly. 13. You don't have to make great effort to maintain NPOI, NPOI TeamWill be updated and improved continuously NPOI, Absolutely saving costs. 14, not only to and Excel can be operated, for doc, pptfile can also do the corresponding operation use case: Refer to blog site: http://www.cnblogs.com/stone_w/archive/2012/08/02/2620528.html

 

15. How many data transfer methods are available between pages?

 

16. The format of json data transmission. If a group of data is transmitted, what is the format?

Json data is transmitted in key/value mode, for example: {"firstName": "Brett "}

If a group of data is transmitted, the format is as follows !!

{ "people": [

{ "firstName": "Brett", "lastName":"McLaughlin", "email": "aaaa" },

{ "firstName": "Jason", "lastName":"Hunter", "email": "bbbb"},

{ "firstName": "Elliotte", "lastName":"Harold", "email": "cccc" }

]}

17. What are database locks and what are the locks? What is the role? How to use it?

18. What is a transaction? When Will transactions be used? What are the benefits and disadvantages of transactions?

19. What is dependency injection, when to use it, and what are the advantages of using it?

20. What is socket communication?

21. What is MQ?

22. How does ajax work?

Principles of ajax
XMLHttpRequest is the core mechanism of ajax. It is first introduced in ie5. it is a technology that supports asynchronous requests. Simply put, javascript can promptly request and process responses to the server without blocking users. Achieve the effect of refreshing. We can regard the server as a data interface, which returns a plain text stream. Of course, this text stream can be in XML format, Html, or Javascript code, it can also be a string. At this time, XMLHttpRequest requests this page from the server, and the server writes the text results to the page. This is the same as the normal web development process, after the client asynchronously obtains this result, it is not directly displayed on the page, but processed by javascript first, and then displayed on the page. Many popular ajax controls, such as magicajax, can return other data types such as DataSet, but only encapsulate the results of this process. In essence, there is no big difference between them.

 

23. What is ORM? How to use it?

24. Database row-to-column and column-to-row

25. How to optimize database queries?

26. What is the difference between convert. toint32, int, and parce?

Convert. ToInt32 converts the object class type to the int type

Int. Parse is suitable for converting string type to int type.

(1) Convert. ToInt32 has many parameters. Int. Parse can only be converted to string type.
(2) Parse converts String to int, char, double..., and so on, that is, it must be string in the brackets *. Parse (string ..

 

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.