Thursday, January 2, 2014

Interview-RG Answers

1) What about security in web services?
 Using Soap Header

2) How will you overload methods in web services?
Using MessageName attribute

3) What is the use of eval function?
To evaluate the expression.

4) What is XMLHTTP Object?
The XMLHttpRequest object is used to exchange data with a server behind the scenes.
It help us in following ways
Update a web page without reloading the page
Request data from a server after the page has loaded
Receive data from a server after the page has loaded
Send data to a server in the background


5) If you have two xml with same structure and we have to create single with distinct data. How will you do that?

6) If there are duplicate rows in data table how will you get distinct row in ADO .Net and SQL server.

7) Have you used SQL Profiler?
SQL Profiler used for monitoring in SQL server. To check the performance which procedure or function making the application slow.

8) Static variables in C#?
Static variables can be used without objects. And they have common value for all objects.

9) Difference between Dispose and Finalizer.
The finalizer method is called when your object is garbage collected and you have no guarantee when this will happen (you can force it, but it will hurt performance).
The Dispose method on the other hand is meant to be called by the code that created your class so that you can clean up and release any resources you have acquired (unmanaged data, database connections, file handlers, etc) the moment the code is done with your object.
The standard practice is to implement IDisposable and Dispose so that you can use your object in a using statment. Such as using(var foo = new MyObject()) { }. And in your finalizer, you call Dispose, just in case the calling code forgot to dispose of you.


10)What is clustered index?

11) What will you do improve the performance of a page?

12) What is difference between dataset and DataReader.

13) If you have two millions rows in database than which one you will use dataset or datareader?
Data Reader

14) What is the use of yield keyword?
Yield used in iterator block.

15) What is dispathcer?
The Dispatcher maintains a prioritized queue of work items for a specific thread.

16) Which interface do you use in Remoting?

17) How will you use SOAP Header in Web Services?
Soap Header used for security in Web Service. You have to define your own class derived from  System.Web.Services.Protocols.SoapHeader class.

No comments:

Followers

Link