What should I know when I learn. net?

Source: Internet
Author: User

Scott Hanselman, http://www.hanselman.com/blog/WhatGreatNETDevelopersOughtToKnowMoreNETInterviewQuestions.aspx author
Translator: Tony Qu

A few days ago, I sent a list of ASP. NET interview questions. Some visitors thought I was okay, and there were some trivial issues. The rest of the people said, "It's pretty good. I have to take a look at some of these questions." I prefer the reply from the latter. I think the latter is the correct attitude.

Of course, I don't want to generalize. NET software development into some simple small problems. I just want to let everyone think more. I believe that a really good ASP. NET (and WinForm) developer should not only drag and drop controls into the designer, but also learn more. A good racing player knows his driving skills. What can he do? What cannot be done?

So I have prepared another list-an extended list for you to use. This was written on a board on my way from Boise to Portland last week, and I also considered the comments that thought my list was too trivial and tried to manage it by section. If you have never gone deep into ASP. NET, you certainly won't know the answers to all ASP. NET questions. If you are an independent consultant, you may never have encountered these concepts. But I have encountered these problems during my 4 years in Collins. Therefore, whether you fully understand these problems may have nothing to do with whether you are a good developer, but it can help you save a lot of time when you encounter problems.

Anyone using. NET

1) What is the difference between a thread and a process?

Both threads and processes define some boundary. The difference is that processes define the boundary between applications, different processes cannot share code and data space, while threads define the boundary of code execution stack and execution context. A process can contain several threads and create multiple threads to complete a task at the same time, that is, multithreading. Different threads in the same process share code and data space. In a metaphor, if a family represents a process, each member in the family is a thread, and every member in the family is obligated to accumulate wealth in the family, at the same time, the family has the right to consume family wealth. when facing a task, the family can also send several members to complete the work together, people outside the family cannot directly consume the property of their own families.

2) What is a Windows service? What is its lifecycle different from that of a standard EXE program?

Windows Service is an application running under the specified user (default System) in the windows background. It does not have a standard UI interface and is similar to a standard EXE program, A Windows service is created at the beginning of the service and destroyed at the end of the service. You can also set whether the service is started with the operating system and disabled together. It supports three methods: 1) automatic mode 2) manual mode 3) disabled. When the automatic mode is enabled, the windows service starts automatically after the OS is started, and the manual mode must start the service manually. If the disabled mode is disabled, the service cannot be started. In addition, standard EXE uses the currently logged-on user by default, while windows uses the System user by default, which requires special attention when accessing System resources.

3) What is the maximum memory size that a single Windows process can access? Is it the same as the maximum virtual memory of the system? What is the impact on system design?

For the hardware platform, the formula is as follows: the maximum memory size that a single process can access = 2 to the power of the number of processor digits/2. For example, under a 32-bit processor, the maximum memory size that a single process can access is 232/2 = 2G. The maximum amount of memory that a single process can access is 1/2 of the maximum virtual memory, because half of the virtual memory is allocated to the operating system.

4) What is a strong type and a weak type? Which one is better? Why?

A strong type determines the type of data during compilation. The type cannot be changed during execution, but the weak type determines the type during execution. No, either of them has its own advantages. Strong type security, because it has been determined in advance, and the efficiency is high. It is generally used in compiled programming languages, such as c ++, java, c #, pascal, etc. The weak type is not safe compared to other programming languages. It is prone to errors during running, but it is flexible, it is mostly used in interpreted programming languages, such as javascript and vb.

5) What is PID? How to use the system in troubleshooting?

PID is the process number. When the system discovers a fault, you can find the specific process of the fault based on it, you can also use visual studio.net and other ides to attach the faulty process to the process for debugging (debug)

6) How many processes can listen on a single TCP/IP Port?

The following code can be used for multiple ports (thanks to the frog pond Reminder ).

Port multiplexing Socket socket1 = new Socket (AddressFamily. interNetwork, SocketType. stream, ProtocolType. tcp); Socket socket2 = new Socket (AddressFamily. interNetwork, SocketType. stream, ProtocolType. tcp); socket1.Bind (new IPEndPoint (IPAddress. parse ("127.0.0.1"), 8235); socket1.Listen (10); socket2.SetSocketOption (SocketOptionLevel. socket, SocketOptionName. reuseAddress, true); socket2.Bind (new IPEndPoint (IPAddress. parse ("127.0.0.1"), 8235); socket2.Listen (10); Console. read ();

7) What is GAC? What problems does it solve?

Gloal Assembly Cache: global application Assembly Cache. It solves the problem that several programs share an assembly. You no longer need to copy the shared assembly to the application directory. In fact, this principle is very simple ,. when a. net application is loaded, it first checks the global application Assembly Cache. If yes, it can be used directly without searching in the application directory.

Intermediate. NET developers

1) explain the differences between interface-oriented, object-oriented, and Aspect-Oriented Programming

APIs are more concerned with concepts. The principle is to define the behavior norms first, and then create and implement them according to the behavior norms. Strictly speaking, interfaces should be part of the object-oriented model, because object-oriented also emphasizes the Dependency inversion principle, that is, implementation depends on abstraction, while abstraction does not depend on specific implementation. What's more, it should be interface-oriented and abstract-oriented, in my experience, the interface-oriented approach is more flexible, but there is a little bit of code redundancy in implementation. Abstract-oriented approach can be combined with interface-oriented approach, first defining interfaces, then defining abstract classes, process some public logic in the abstract class, and then implement the specific implementation class. Object-oriented is the decomposition of complex problems. Aspect-oriented programming is a new concept that solves many problems that object-oriented cannot solve. For example, object-oriented technology can only modularize business-related code, however, it is impossible to modularize the code unrelated to the business. Aspect-oriented is the solution to this problem. Its key idea is to "separate the business logic in the application from the general service that provides support for it ".

2) What is Interface? What is the difference between it and Abstract Class?

Interfaces are used to define behavioral norms without specific implementations. abstract classes can be partially implemented in addition to defining behavioral norms, but a class can implement multiple interfaces, but only one parent class can be inherited.

3) What is reflection?

An Assembly contains a module, and a module includes a type. There are members under the type. Reflection is the management assembly, module, and type object. It can dynamically create instances of the type, set the existing object type or obtain the existing object type. You can call the method of the type and the field attribute of the access type. It is created and used at runtime.

4) What is the difference between the XML Web Service using ASMX and the. NET Remoting service using SOAP?

The message mechanism used by the Web Service, while the RPC. Web Service used by Remoting can be used on different platforms and languages. Remoting is only applicable to. Net. Remoting is more efficient than Xml Web Service.

5) is the type system represented by XMLSchema? Is CLS represented by XMLSchema?

Not clear

6) What is the difference between early-binding and late-binding?

This is similar to the strong and weak types. The pre-binding determines the data to be bound during compilation, and the post-binding completes data filling during running. Therefore, if binding fails in the early stage, a compilation error will be reported during compilation, and later binding fails only at runtime.

7) Call Assembly. Load to calculate static reference or dynamic reference?

Dynamic

8) When to use Assembly. LoadFrom? When to use Assembly. LoadFile?

Haha, this is quite interesting. Compared with LoadFile, LoadFrom is not authentic, because when it takes a daughter-in-law, it is to let people wear dowry, sit in the carriage, and have to take their sister, :) It is used to load the assembly, which requires that the Assembly on which this Assembly depends be loaded at the same time. While LoadFile is a lot more authentic. It loads the content of the Assembly file, and only loads the file of the input parameter, regardless of the Assembly dependency, but if there is the same implementation, however, LoadFrom cannot be used to load files with different locations, but LoadFile can. Because LoadFile loads a file, after calling it, it may be unable to be executed due to the lack of necessary dependencies.

9) What is Assembly Qualified Name? Is it a file name? What's the difference?

It is not a file Name. Compared with the file Name, Assembly Qualified Name (Assembly Qualified Name) can better determine an Assembly. It contains the file Name, but also contains the version, public key, and region. The file with the same name may have different versions and regions. In this case, the file name alone may cause the correctness of the assembly to be uncertain.

10) Assembly. Load ("foo. dll"); is this statement correct?

Error. The correct one should be Assembly. Load ("foo"); or Assembly. LoadFrom ("foo. dll"); (thanks to Tristan (Guozhijian) for prompt correction)

11) What is the difference between an assembly with strong signatures and an assembly without strong signatures?

A strongly signed assembly can be made into com without strong signature. A strongly signed assembly can be installed in GAC without strong signature.

12) can DateTime be null?

No, because it is of the Struct type, and the structure belongs to the value type. The value type cannot be null. Only the reference type can be assigned null.

13) What is JIT? What is NGEN? What are their limitations and benefits?

Just In Time is compiled In a timely manner. It is compiled when the program is run for the first Time. NGEN is called pre-jit, which means that the native image of the Assembly will be generated before running, and save it to the global cache. NGEN can accelerate assembly loading and execution because it can restore the code and data structure from the local image, instead of generating them dynamically as jit does. The reason for caching is similar.

14) What is the difference between Finalize () and Dispose?

Finalize () is used to implicitly release resources, and Dispose () is used to display the release resources (Finalize () is indeed equivalent to the destructor in C ++ (thanks to Jeffrey Zhao for prompting correction)

15) is the using () syntax useful? What is IDisposable? How it achieves the final certainty.

Is used to create an IDisposiable class in using. After using is completed, the Dispose method of the object is called to release resources. I don't understand what is the end of certainty

16) What is the tasklist/m "mscor *" command?

Lists all processes and modules that use a dll or exe starting with "mscor ".

17) differences between in-proc and out-of-proc

In-proc is the process, where code and data blocks can be shared within the process, out-of-proc is the process, and inter-process interoperability needs to be achieved through inter-process communication.

18) which technology in. NET can implement out-of-proc communication?

. Net Remoting technology or WCF Technology

19) which process does ASP. NET run on Windows XP, Windows 2000, and Windows 2003 respectively?

Xp: aspnet_Wp.exe Windows 2000: aspnet_Wp.exe Windows 2003: w3wp.exe

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.