Wednesday, August 13, 2008

Dot NET Interview Questions

Q. Which is the Base class for all the classes in .NET?
A. System.Object

Q. What is the differece between .ToString() and Convert.ToString()?
A. .ToString() can not handle null, while Convert.ToString() handles null and does not raise a null value exception.

Q. What is the difference between bool and Boolean?
A. No difference they both refers to the same, and also same is with string/String, int/int32, etc..

Q. Can we set an integer values as null?
A. No.

Q. Can we print the Panel Control?
A. Yes, by passing the panel area to the bitmap object and then send that to the printdocument, through panel.DrawtoBitmap() method.

Q. What happens to the Print when printing data exceeds one page?
A. It is automatically passed to the second page.

Q. Which are the three pillars of any object oriented Programming Language?
A. 1. Encapsulation.
2. Polymorphism.
3. Inheritance.

Q. Do .Net provides multiple inheritance?
A. No.

Q. How can we achieve multiple inheritance in .Net?
A. With the help of interfaces.

Q. An interface must have atleast one abstract Method Yes or No?
A. Yes.

Q. What is a Partial class, how it is usefull?
A. A partial class is a simple class same as other class. but has a facility that, i can be distribute in many .cs files. When they are complied they form a single class. It is usefull when developement is going on in different places all the developers can have their own partial class which can be merged during compilation.

Q.How many web.config files does a single web application can have?
A.Depends on the Applciation behaviour, a single web application have atleast one web config file, but can have more than on web.cinfig files.

Q.What is the differece between a Class and A Module?
A.You can initialize a class but you can not initialize a Module. The scope of the class depends on the available of the class object, but the scope of a module is upto the entire application

Q.What is the difference between Interface and Abstract Class.?

Q.What is a Sealed Class, how it is useful in Object Oriented Concept of C#?

Q.What is Components and Assembly?

Q.What is User Control, how it is useful?

Q.What are Delegates and Events?

Q.Explain the concept of Threading. What is deadlock?

Q.Can we have more than one thread in one Application?

Q.What is the minimum number of Thread/s does any .NET application have?

Q.What is ADO.NET?

Q.How ADO.NET is different from ADO?

Q.Explain the difference between ExecuteNonQuery() and ExecuteScalar() methods of ADO.NET.

Q.What is a DataSet? How it is useful?

Q.What is a Master page ASP.NET?

Q.What is bubbled Event?

Q.What is a ToolTip Class?

Q.How to pass values to the constructor of parent class from the child class when inherited, Give example with Code.

Q.Explain the concept of overloading, how it is useful?

Q.What is Boxing and UnBoxing?

Q.What is DLL Hell?

Q.What is strong type DLL?

Q.What is Exception Handling ? Which is the Main class for any exceptions?

Q.Explain difference between continue, break, return.

Q.Explain Dispose() Method.

Q.Which is more applicable in programming, goto or switch?

Q.Name the class which .NET automatically creates when you create New Project which contains Main() Method.

Q.Which is executed first Form_Load() or Form_Activate()?

Q.Write Code sample for Creating DataTable in Memory with one Primary Key
Column?

Q.How can I programmatically add New Line to TextBox Control, if its MultiLine Property is set to true.

Q.What is Indexing?

Q.What is the difference between const and static?

Q.Enums are static to its class? Yes/No

Q.What is the difference between Array and ArrayList?

Q.Verify the below Code, What will be the output?

Int32 InntegerData=50;
object obj = new object();
obj= (object)IntegerData;
string StringData= Convert.ToString(obj);
MessageBox.Show(StringData);

Q.What will be the output of the below Code
TextBox textbox= new TextBox(“Hello!, Keep Smiling”);
MessageBox.Show(textbox.ToString());

Q.What are resources? Explain the difference between Embedded and Linked resources?

Q.Which Namenpace I will use to get the current MachineName?

Q.what is finalizer? How it is useful?

Some .NET Interview Questions

Q.Which is the Base class for all the classes in .NET?
A.System.Object

<