. Net programmer interview intermediate (answer Scott hanselman's question)

Source: Internet
Author: User

Following 《. net programmer interview C # Language (answer Scott hanselman's question 《. net programmers interview everyone should know the article (answer Scott hanselman's question), today, answer Scott hanselman's"Intermediate. netProgramProblems that the staff should know".

 

1.Differences in interface-oriented, object-oriented, and direction-Oriented Programming(Describe the difference between interface-oriented, object-oriented and Aspect-Oriented Programming .)

 

Interface-oriented (interface-oriented): In fact, interfaces are frequently used in projects, but they are never known as interface-oriented programming. The advantage of using interfaces is to reduceCodeThe degree of coupling. For example, a URL can be accessed only after login. If thisurl: iauthentication, you do not need to worry about authentication when implementing thisurl class. Another advantage of using the interface is that when the thisurl class is tested in units, mock iauthentication can be used.

 

Object-oriented (Object-Oriented): I have never strictly defined myself, but I know that an object is stateful and has methods. Similar objects are abstracted as classes, and objects are specific classes. Object-Oriented Programming involves encapsulation, multiple sets, inheritance, and other concepts.

 

Aspect-oriented (orientation): A programming method that avoids repetitive code. When the same function is repeatedly used in many parts of the Code, e.g. Logging can be used to process the logic of logging in a unified manner using aspect. The Ted neward Challenge (AOP without the buzzwords)ArticleIt is very helpful for me to understand this concept.

 

2.Differences between interfaces and ClassesDescribe what an interface is and how it's different from a class.

Interface): It cannot be real-listed. It has no status and no specific implementation of the method. When it is inherited, the inherited class must implement all methods of the interface. The interface is like a rental contract template downloaded online when renting a house.

Class): It can be instantiated and stateful. When it is inherited, the inherited class does not need to be implemented again in the inherited class. However, if the methods of the inherited class have abstract modification, the inherited class needs to implement this method. Class is like a template of a rental contract that has been filled in.

 

3.What is reflection?What is reflection?

The code dynamically obtains the assembly information and object information during running, or directly calls the method or attribute e.g. var I = 100; I. GetType (); outputs system. int32.

 

4.Differences between XML Web Service and. Net remoting(What is the difference between XML Web Services Using asmx and. Net remoting using soap ?)

XML Web Service: it is an open standard that uses HTTP/SOAP protocol for interaction.

. Net remoting: it is a Microsoft technology and can only be used in. net.

Because I have never touched asmx or. NET remoting, I can only learn about it. I can see an answer on the Internet, which is more detailed:

remoting assumes the other end is. net. this is because. net remoting using soap uses the soapformatter to serialize data. soapformatter embeds the type information required to deserialize the object into the message itself. this requires that the client and the server must have access to this Assembly. remoting believes in. net Type System. remoting believes in sharing types and assemblies. remoting can support DCOM style client activated objects which are stateful. the use of CAOs though have to be carefully thought about because CAOs cannot be load balanced. asmx model does not assume that the other end is. net. asmx uses xmlserializer to serialize data. xmlserailizer believes that the XML type system, that is the XSD is superior and works on serializing data conforming to a schema. in other words XML Web Services believe in sharing schema and contracts over types and assemblies. this makes the web services interoperable. asmx services are usually stateless.

 

5.Is the type system of XMLSCHEMA and CLS in the same shape?(Are the type system represented by XMLSCHEMA and the CLS isomorphic ?)

I checked the Baidu to find out what the isomorphic means,Isomorphic form. XMLSCHEMA is not exactly the same as the CLS type system. For example, for the number type, XMLSCHEMA has a type not available in. net, such as negativeinteger.

 

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

I don't know if it is translated like this. Early-binding: indicates binding at compilation, and late-binding indicates binding at runtime. e.g. Person. dosomething () Early binding.
Late binding:

 

  1   Type animal  =    Typeof  (Animal );
2   Object O = Activator. createinstance (animal );
3 VaR text = Animal. invokemember ( " Dosomething " , Bindingflags. Default | Bindingflags. invokemethod, Null , O, Null );

 

 

 

7. Is using assembly. Load a static reference or dynamic reference?

Dynamic

 

8.When can I use assembly. loadfrom or assembly. LoadFile?? (When wocould using assembly. loadfrom or assembly. LoadFile be appropriate ?)

I don't quite understand. When is it suitable? Does anyone know?

 

9.What is the qualified name of an assembly? Is it a file name? If not, what is the difference?(What is an asssepolicy qualified name? Is it a filename? How is it different ?)

An assembly name consists of four parts: file name, excluding the suffix, Public Key token, culture, and version. Different from the file name,

 

10.Is assembly. Load ("foo. dll") correct?(Is this valid? Assembly. Load ("foo. dll ");)

No,Assembly. Load("Foo, version = 1.0.2004.0, culture = neutral, publickeytoken = 8744b20f8da049e3")

 

11.Stronugly-named assembly and non-stronugly-namedAssemblyWhat's the difference?(How is a stronugly-named Assembly different from one That isn' t stronugly-named ?)

Stronugly-named assembly can ensure the uniqueness of the assembly and prevent the use of the Assembly that has been tampered with by others

 

12. Can datetimes be null?

Datetime cannot be null.

 

13.Explain JIT, ngen, and their advantages and disadvantages? (What is the JIT? What is ngen? What are limitations and benefits of each ?)

JIT: Just in Time compilation; advantage: Any JIT can be compiled; disadvantage: Long start time.

Ngen: directly compiled into machine code. Advantage: Long startup time; disadvantage: it can only run in the system.

 

Are you sure you want to explain this? Please correct yourself.

 

14. How does the generational garbage collector in the. net clr manage object lifetime? What is non-deterministic finalization?

CLR divides objects into three generations ,.. Net GC determines the lifetime of an object by the time it is created. objects with a short creation time are collected earlier, and objects with a long creation time are collected later.

Non-deterministic finalization means that you have no way to determine or control the collection of an object by GC.

 

15.Difference between finalize () and dispose ()(What is the difference between finalize () and dispose ()?)

When GC collects an object and calls finalize (), the programmer cannot call it. however, the programmer is responsible for using dispose () when using unmanaged resources to ensure that the resources are collected by GC in a timely manner.

 

16. How is the using () pattern useful? What is idisposable? How does it support deterministic finalization?

Using () ensures that dispose () is called when the using () block ends. idisposable has only one method, dispose (). When a class inherits idisposable and the class object uses using (), dispose () is called.

 

17. What does this useful command line do? Tasklist/M "mscor *"

List all the processes that use the pattern in quotes.

 

18. What is the difference between in-Proc and out-of-proc?

In-Proc occurs within a process, and out-of-Proc occurs between different processes.

 

19. What technology enables out-of-Proc communication in. Net?

. Net remoting

 

20. When you're running a component within ASP. NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?

Windows XP and 2000: aspnet_wp.exe

Windows 2003: w3wp.exe

 

It took me a long time to answer these 20 questions. Many of them were only known after reading many articles through Google. It seems that there are still a lot of courses to be completed to become a qualified intermediate. Net programmer.

 

I'm curious. I don't know how many. Net programmers in my blog are familiar with these questions?

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.