Search!!

Loading...

Followers

Jun 17, 2011

Microsoft .NET Interview Question Answers - 2

Basic Microsoft Dot Net Interview Question Answers asked in Wipro,Infosys,TCS


What is Singleton pattern?
Singleton pattern ensures a class has only one instance & provide a global point of access to it. It is achieved by declaring a static variable for the class & checking for null before actually instantiating it.

Where reference and value types variables are stored?
All reference type variables are stored in heap (Random) and all value types variables are stored in stack (Sequential). 

What is multi-threading?
It is basically trying to do more than one thing at a time within a process.

There are two main ways of multi-threading which .NET encourages: starting your own threads with ThreadStart delegates, and using the ThreadPool class either directly (using ThreadPool.QueueUserWorkItem) or indirectly using asynchronous methods (such as Stream.BeginRead, or calling BeginInvoke on any delegate).

What’s difference between System.SystemException and System.ApplicationException?
The difference between ApplicationException and SystemException is that SystemExceptions are thrown by the CLR, and ApplicationExceptions are thrown by Applications.

What is MSIL?
MSIL (Microsoft Intermediate Language) is a CPU-Independent instructions set into which .NET Framework programs are compiled. It contains instructions for loading, storing, initializing and calling methods on objects.

What is CLS?
CLS (Common Language Specification) is a set of constructs or constraints that serves as a guide for library writers and compiler writers.It allows libraries to be fully usable from any language supporting the CLS, and for those languages to integrate with each other. The CLS is a subset of common type system. The common language specifications is also important to application developers wh are writing code that will be used by other developers.

What is CTS?
CTS (Common Type System) is a rich type system, build into the common language runtime that supports the types and operations found in most of the programming languages. The common type system supports the complete implementation of a wide range of programming language.

What does apsx stand for?
Active Server Pages Extension

What is StringCollection?
StringCollection is a simple resizable collection of strings
Following function shows how to insert and retrive data into/from StringCollection.
public static string GetStringCollection()
{
System.Text.StringBuilder strB = new System.Text.StringBuilder();
// Add strings into StringCollection
System.Collections.Specialized.StringCollection strC = new System.Collections.Specialized.StringCollection();
strC.Add("Ram 1");
strC.Add("Ram 2");
strC.Add("Ram 3");
strC.Add("Ram 4");
strC.Add("Ram 5");


// Retrieve string from StringCollection
System.Collections.Specialized.StringEnumerator coll = strC.GetEnumerator();
while (coll.MoveNext())
{
strB.Append(coll.Current + "
");
}
return strB.ToString();
}

What is the use of RCW & CCW?
RCW : Runtime Collable Wrapper takes a COM component, wrap it up and allows .NET client to consume it.
CCW: COM Collable Wrapper wraps a .NET object for consumption by COM client

List few ValueTypes variables.
Below are all ValueTypes variables.
System.SByte,
System.Byte
System.Int16
System.Int32
System.Int64
System.Single
System.Double
System.Decimal
System.Char
System.Boolean
System.DateTime

String is a value type or reference type?
String is a reference type variable.

No comments:

Post a Comment

 

Aired : Interview Questions | Certifications | Tutorials | Career Help | Copyright © 2009-2013