Interview Questions - Part 2

When to use Interface?

Use an interface when:

There are a group of related methods that may be called.

A class only needs one implementation of the method.

The class using the interface will want to cast that interface to other interface or class types.

The method being implemented is linked to the type or identity of the class: for example, comparison methods.

When to use delegates?

Use a delegate when:

An eventing design pattern is used.

It is desirable to encapsulate a static method.

The caller has no need access other properties, methods, or interfaces on the object implementing the method.

Easy composition is desired.

A class may need more than one implementation of the method.

Service contracts?

Data Contracts?

What keyword shadowing?

What is keyword yield?

What are different kinds of Cursors?

What are different kinds of triggers?

What is var?

What is the difference between memory table v/s temp tables?

Why u have not used cursors in ur project?

When u ll go for win forms and web app?

What is strong naming and why its needed?

What are context instance mode in wcf?

What are the securiy modes available in wcf ?

What are transaction modes in wcf?

Why are you hosted ur wcf services in iss , why not in anu other service

How are accessing wcf from client side?

What is sql dependency injection?

Why are u using wcf over web servies?

How about sessions in WCF?

Session modes in asp .net?

What is rowcommand event in gridview?

IIS internals?

What is Generic in C#?

What all the bindings in WCF and which one u have used?

What is WSHttpBinding?

What are the new features in .NET 4.0?

How to use LINQ and why?

What is Lambda expression?

What is the meaning of '=>' in Lambda expression?

Few questions in Agile methodology?

What is 'volatile' in C#?

The volatile keyword indicates that a field might be modified by multiple threads that are executing at the same time. Fields that are declared volatile are not subject to compiler optimizations that assume access by a single thread. This ensures that the most up-to-date value is present in the field at all times.

The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock statement to serialize access.

The volatile keyword can be applied to fields of these types:

Reference types.

Pointer types (in an unsafe context). Note that although the pointer itself can be volatile, the object that it points to cannot. In other words, you cannot declare a "pointer to volatile."

Types such as sbyte, byte, short, ushort, int, uint, char, float, and bool.

An enum type with one of the following base types: byte, sbyte, short, ushort, int, or uint.

Generic type parameters known to be reference types.

IntPtr and UIntPtr.

The volatile keyword can only be applied to fields of a class or struct. Local variables cannot be declared volatile.

Can I have public constructor and private static constructor in a class? If Yes, then in which situation we should use it?


More are coming....>

Comments

Popular posts from this blog

Interview Questions to Ask the Employer

Place .NET DLL in GAC

Windows Communication Foundation - FAQ