Monday, May 14, 2012

.NET FRAMEWORK INTERVIEW QUESTIONS

 .NET FRAMEWORK INTERVIEW QUESTIONS

What is Interface based polymorphism ?

 Answer:

Interfaces provide another way you can accomplish polymorphism in Visual Basic. Interfaces describe properties and methods like classes, but unlike classes, interfaces cannot provide any implementation. Multiple interfaces have the advantage of allowing systems of software components to evolve without breaking existing code.

To achieve polymorphism with interfaces, you implement an interface in different ways in several classes. Client applications can use either the old or the new implementations in exactly the same way. The advantage to interface-based polymorphism is that you do not need to re-compile existing client applications to get them to work with new interface implementations.

For More information: 
http://msdn.microsoft.com/en-us/library/z9k8e08x%28v=vs.90%29

What is Deferred Execution of LiNQ ?

Answer:

http://blogs.msdn.com/b/charlie/archive/2007/12/09/deferred-execution.aspx

What is explicit implementation of Interfaces ?

http://msdn.microsoft.com/en-us/library/aa288461%28v=vs.71%29.aspx

What is Keyword Extern ?

Answer:

  The extern modifier is used to declare a method that is implemented externally. A common use of the extern modifier is with the DllImport attribute when you are using Interop services to call into unmanaged code .


http://msdn.microsoft.com/en-us/library/e59b22c5%28v=vs.90%29.aspx

Tell me about constructor Hierarchy ?

http://www.yoda.arachsys.com/csharp/constructors.html

How GC(Garbage Collector) will evaluates an object is unused ?

 http://msdn.microsoft.com/en-us/library/system.gc%28v=vs.90%29.aspx

What is the difference between interface and abstract class ?

 Difference between Interface and abstract class :

The choice of whether to design your functionality as an interface or an abstract class (a MustInherit class in Visual Basic) can sometimes be a difficult one. An abstract class is a class that cannot be instantiated, but must be inherited from. An abstract class may be fully implemented, but is more usually partially implemented or not implemented at all, thereby encapsulating common functionality for inherited classes. For details, see Abstract Classes.
An interface, by contrast, is a totally abstract set of members that can be thought of as defining a contract for conduct. The implementation of an interface is left completely to the developer.
Both interfaces and abstract classes are useful for component interaction. If a method requires an interface as an argument, then any object that implements that interface can be used in the argument.

This method could accept any object that implemented IWidget as the widget argument, even though the implementations of IWidget might be quite different. Abstract classes also allow for this kind of polymorphism, but with a few caveats:


Classes may inherit from only one base class, so if you want to use abstract classes to provide polymorphism to a group of classes, they must all inherit from that class.
Abstract classes may also provide members that have already been implemented. Therefore, you can ensure a certain amount of identical functionality with an abstract class, but cannot with an interface.
Here are some recommendations to help you to decide whether to use an interface or an abstract class to provide polymorphism for your components.


If you anticipate creating multiple versions of your component, create an abstract class. Abstract classes provide a simple and easy way to version your components. By updating the base class, all inheriting classes are automatically updated with the change. Interfaces, on the other hand, cannot be changed once created. If a new version of an interface is required, you must create a whole new interface.
If the functionality you are creating will be useful across a wide range of disparate objects, use an interface. Abstract classes should be used primarily for objects that are closely related, whereas interfaces are best suited for providing common functionality to unrelated classes.
If you are designing small, concise bits of functionality, use interfaces. If you are designing large functional units, use an abstract class.
If you want to provide common, implemented functionality among all implementations of your component, use an abstract class. Abstract classes allow you to partially implement your class, whereas interfaces contain no implementation for any members.

What is Generics and the need of generics ?

Difference between list and sorted list ?

What is the scope of Session ?

What is the property to know is Client is connected ?

What are all the new key words introduced in .Net 4.0 ?

What is the default access modifier for a class ?

Answer: Private

What is GetHashCode?

Ans: GetHashCode Serves as a hash function for a particular type.  

http://msdn.microsoft.com/en-us/library/system.object.gethashcode.aspx

Can we have a abstract class without any any abstract method in it ?

Yes










We collect videos & images from online sites like youtube and some other websites which provide them. And most of the News is also gathered from other online websites. Any material downloaded or otherwise obtained through the use of the service is done at your own discretion and risk and that you will be solely responsible for any damage to your computer system or loss of data that results from the download of any such material. If you feel that the content on the site is illegal or Privacy please contact us at srinuchalla@gmail.com and such videos, images or any Content will be removed with immediate effect.