Tuesday, April 28, 2009

FAQ'S

What is the difference between Session.Abandon() and Session.Clear()?
The major practical difference is that if you call Session.Abandon(), Session_End will be fired (for InProc mode), and in the next request, Session_Start will be fired. Session.Clear( ) just clears the session data without killing it.

Themes:A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in a Web application, across an entire Web application, or across all Web applications on a server.

The drawback to the DataGrid's built-in paging functionality:With each page change a PostBack event fires and the data source is recreated and re-bound to the DataGrid.The entire data source, not just the single page being displayed. If the table you are paging through has one million records in it, all one million records are queried, transported to the application, and then a select few (the current page) are displayed,where you may run into a slight performance issue with this.

What is the Main difference between String and StringBuilder and why do we use StringBuilder.
String bulider Can Be Used When More Than One String Can we concatenated.
StringBuilder which is more efficient because it does contain a mutable string buffer. .NET Strings are immutable
which is the reason why a new string object is created
every time we alter it (insert, append, remove, etc.).
StringBulider Is more Effiecent Then String B'Cuse It
Provide Some Standered Function like Append,Reverse,Remove
etc.


can machine.config file orverrides web.config. For example: if u set session timeout as 30 mins in web.config file to a particular application and if u set session timeout as 10 mins in machin.config. what will happen and which session is set to the appliction?
As the Web.Config file defines application level settings.It'll override the settings of the machine.configfile.So the session timeout as 30 mins defined in web.configfile is set to the application.

How is a property designated as read-only?
in C#
public returntype PropertyName
{
get{
//property implementation goes here
}
// Do not write the set implementation
}

Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.

Can we use Truncate command on a table which is referenced by FOREIGN KEY?
No. We cannot use Truncate command on a table with Foreign Key because of referential integrity.

What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?
Having Clause is basically used only with the GROUP BY function in a query. WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

Serialization:
Serialization is the process of converting an object into a stream of bytes in order to persist it to memory, a database, or a file. Its main purpose is to save the state of an object in order to be able to recreate it when needed. The reverse process is called deserialization.

What is abstract class ? when is used in real time ?
An Abstract Class is one in which the member function(s) at the Base(Parent) Class are left undefined, but declared. It's upto the Derived(child(ren)) Classes to Implement the Functions declared in Base...
Ex:
Let us assume... As a father(Base Class), he has some Land (Member Function), and he has not done any cultivation (implementation) in it... As his Child(Derived Class), he takes the Land(Member Function) from the Father(Base) and does Agriculture(implementing the M.F. of Parent Class) in the Child...
Do I need IIS to run Web applications?
If you are using Visual Studio, you can use the ASP.NET Development Server built into Visual Studio to test your pages. The server functions as a local Web server, running ASP.NET Web pages in a manner virtually identical to how they run in IIS. To deploy a Web application, you need to copy it to a computer running IIS version 5 or 6.


Difference between Set and Select

Set is a ANSI standard for variable assignment.

Select is a Non-ANSI standard when assigning variables.

We can assign only one variable at a time

We can assign multiple variable at a time

When assigning from a query that returns more than one value, SET will fail with an error.

When assigning from a query that returns more than one value, SELECT will assign the last value returned by the query and hide the fact that the query returned




10 Important .NET OOP interviews questions

What's the most asked question in OOP from Interviews perspective?

If you are fresher you will be asked the Why OOP's and the 4 important properties of OOP's programming. Interviewers will then drill down on specific property like encapsulation or abstraction and ask some questions around the same.

If you are experienced professional like 5 yrs and above , he or she will start from your project architecture and then indirectly ask questions like how did you decouple the UI from the business object , how was your class design etc.

How did you implement encapsulation in C# ?

By declaring the properties as privat*e and then using public set and get to wrap those privat*e properties.

What's the difference between abstraction and encapsulation?

Abstraction is a thought process or design approach where we expose only what?s necessary while encapsulation is the process to hide complexity. Encapsulation is way of implementing abstraction. In this question interviewer will try to take you for a ride as abstraction and encapsulation complement each other.

What's the difference between abstract class and interface?

An abstract class can have abstract member?s as well non abstract members. But in an interface all the members are implicitly abstract and all the members of the interface must override to its derived class.

The members of the interface are public with no implementation. Abstract classes can have protected parts, static methods, etc.

Abstract classes can add more functionality without destroying the child classes that were using the old version. In an interface, creation of additional functions will have an effect on its child classes, due to the necessary implementation of interface methods to classes.

Defining an abstract class with abstract members has the same effect to defining an interface.

Can we create an object of interface or abstract class?

No.

What are the 2 different types of polymorphism?

Static and dynamic polymorphism.

How can we implement
Few more question:
1.When to use abstract class and when to use Interface?
2.How will you handle a situation where a class implements two interface having same method name and signature?
3.Can I declare an empty class as abstract?
4.Can a sealed class have virtual method?
5.When u create a parameterized constrcutor then does the default constructor gets created automatically?
6. A
/|\
|
B
/|\
|
C

Is the protected member of A accessible in class C?

No comments:

Post a Comment