Twitter Feed Popout byInfofru

Dotnet Interview Question Series 2

Q1)What is View State?

Ans)It contains state of control, which asp.net runtime reloaded when the post back operation occurs.

Q2)Can you read the View State?
Ans) Yes, For Example:
Response.write(viewstate("myname"))

Q3)Can we disable the view state application wide?
Ans) by specifying the followig line in web.config

Q4)Can we disable it on page wide?
Ans)Yes,by specifying Viewstate="false" in page directive.
<% Page viewstate="false"%>

Q5)can we disable it for a control?

Ans)Yes,by specifying Viewstate="false" in control markup.

Q6)Any idea of Enterprise library?

Ans) Heaven, Enterprise Library is a library from Microsoft Patterens & Practices which provide you with the different application block example
Data Access
Security
Logging
Exception
and much more.
It actually gives you classes to implement different re-useable functionalities.

Q7)What is web service?

Ans) We can assume a web service as a method over the web, It actually takes the parameter and give the result in the XML format for independablity.furthermore, It use SOAP formatted XML enavlops and use WSDL for interfacing.

Q8)What is WSDL?

Ans) It is XML based language which provide a model for describing Web Service, meaning that it gives description how to communicate with Web serice. It use in the combination of XML Schema and SOAP.

Q9)Can a web service be only developed in asp.net?

Ans) No, We can also develop webservices using Java (JSP).

Q10)Can we use multiple web services from a single application?

Ans) Yes...

Q11)can we call a web service asynchronously?

Q12)Can a web service be used from a windows application?

Ans) Yes, the speciliaty of windows service is that it can be called from any where, either windows application or mobile application.

Q13)What do we need to deploy a web service?

1.At the command prompt:

WSDL http://ip address ofthe site/WebService/MathService.asmx /n:NameSp /out:FileName.cs]
-This will create a file called FileNmame.cs .

WSDL -> WebServices Description Language (This is an application available at C:\\Program

Files\\Microsoft.NET\\FrameworkSDK\\Bin)

NameSp -> Name of the NameSpace which will be used in client code for deploying the

webservice.

2.Compilation

CSC /t:library /r:system.web.dll /r:system.xml.dll CreatedFile.cs

This will create a dll with the name of the public class of the asmx file.( In our case, it

is "AddNumbers.dll" )

CSC is an application available at C:\\WINNT\\Microsoft.NET\\Framework\\v1.0.2914

3.Put the dll file inside WWWRooT\\BIN [Create a BIN Folder in WWWRoot]

Q14)What is the significance of web.config?

Ans) It is the most significant part of any application, actually it contain the configuration which can be readable for runtime enviroment and manage the application accordingly.

Q15)Can we have multiple web.config files in a sigle web project?

Ans) Sure, we can have as different web.config file in every single folder for example If I want all the pages "/Presentation" reside in this folder use different database, I write another web.config file and put it under "/presentation". furthermore, we have a default web.config file on the root of web application. if any folder doesnot have its own web.config runtime automatically read the default one for configuration. and evenif there
is no default web.config file located it read machine.config to get the configuration syntax

Q16)Can we have more then one configuration file?
Ans) Yes the method will be same as above


Q17)Type of Authentications?

Ans) Windows, Forms, and Passport

Q18)Can we have multiple assemblies in a single web project?

Ans) The default architecture of .net framework doesnot allow you to create multiple
assemblies of a single project, but we can achieve this target as mentioned here.
http://www.codeproject.com/aspnet/VSMaker.asp
but you see this is not the appropriate way, if one really wants to split the project then I would reccommend to create seprate class library for every module, instead of generating
a dll for every page as mention in the link given above.

Q19)What is GAC?

Ans) GLOBAL ASSEMBLE CACHE, It is a folder located in %system%\\assembly. It is a global
cache for assemblies. Any DLL located in this folder can have full access of using CLR.

Q20)What is machine.config?

Ans) This is configuration file located in c:\\Windows\\Microsoft.NET\\Framework\\{Version Number}\\CONFIG. It holds the information about the dlls, proxy setting and lot more stuff.

Q21)What different types of session state Management we have in asp.net?

Ans) There are following three ways of state managment.
A) Sessions
B) Query String
C) Cookie

Q22)What are cookies?

Ans) It is a small piece of information, residing on client side for the sesssion managment. since web is a connection less medium that is why we need a cookie to persist the connection information.

Q23)What is Cache?

Ans) well caching is a process of storing objects in memory for a specified time period. instead of getting connection to the database and get the new results caching store result in memory and use those results to display And after the time expire it gets the new result from the database and again store in the memory.
we can set cache of the page by writing following directive.
<%@OutputCache Duration="60" VaryByParam="none" %>

Q24)What is AJAX?

It is a programming technique which use to make web pages more responsive by exchanging small amount of information in the way that user dont get idea for it, and instead of page reload or refresh it gets the data from the server.typically it uses the following combination.
HTML / CSS, DOM (Client side scripting) and XMlHttpRequest object

Q25)Is AJAX a language?

Ans) No it is an efficient use of different languages, it is a technique.

Q26)What is the difference between syncronus and asyncronus?

Ans) well synchronus is a connection maintained medium, meaning that connection is maintained between until the work finish. Cell phone Call is a best example for that. I Make a call to my friend now I am connected to him, and the connection is remain established until I disconnect the line whereas asyncronus is a connectionless medium in which we we establish connection just to pass parameter, and then get disconnected. Think about SMS, I connnect to my firnd cell phone just for a second to leave a message, as soon as message sent connection will destroy.


Q27)What is an Assembly?

Ans) Assembly contain inermediate language code which can be execute by CLR, complilers of differnet .net languages such as VB.net , C# generate IL Code in assembly which then can use by CLR.
There are two types of assemblies, (EXE) and (DLL)

Q28)Can an assembly contains more then one classes?

Ans) Yes,

Q29)What is strong name?

Q30)What is the difference b/w client and server side?

Ans) Client is one who is requesting services where as service is providing services.

Q31)What we need for the deployment of a asp.net we application?

Ans) Any webserver that support .net framework. commonly, we use IIS to deploy asp.net application. We use aspnet_regiis (.net command prompt) to install .net framework on any IIS.

Q32)what is the purpose of IIS?

Ans) Internet Information Server, It is a web server that help us to run dynamic web sites.

Q33)Difference between http and https?

Ans) Http is a typical protocol used for data travelling over the web, It is not secure. where as Https is a secure

Q34)what is purpose of aspnet_wp.exe ?

Ans) This is a process used by IIS to execute asp.net application.

Q35)what is an ISAPI filter?

Ans) Internet server Application Programming Interface, It must be written is C++ and the compiled in DLL which then registered in IIS to run on the web server.

Q36)what do you mean by HTTP Handler?

Ans) It is a .net Componenet that implements System.Web.IHTTPHandler interface, any class that inherit this interface can be work as a target of HTTP Request, For HTTPHandler to work we need to define a following line in config file as well or if you ever open machine.config file you will get the following lines which are responsible for showing different file type.

. . . . . .
. . . . . .

Q37)What is the purpose of Global.asax?

Ans) It is an Asp.net Application file, it contains the code for responding to application level and session level events raised by asp.net application.

Q38)What is the significance of Application_Start/Session_Start/Application_Error?

Ans) Application_Start fires whenever the application start or you re-upload bin (dlls) where as session_start is specific for a user means if a new session create for a user this events fire. Application_Error is fire when any error occured.

Q39)What is the difference between the inline and code behind?

Ans) Inline code is written with HTML in <% %> where as code behind code is written in .aspx.vb file.


Q40)what is side by side execution?

Ans) We can run multiple version of .net framework on one system,for example currently I am running 3 versions of .net framework 1.0,1.1 and 2.0. this feature of microsoft known as side-by-side execution.

Q41)can we have two different versions of dot net frameworks running on the same machine?

Ans) That is what Side-by-Side executation is.

Q42)What is CLR? Difference b/w CLR and JVM?

Ans) Well, the basic difference between two is that CLR use intermediate language where as JVM use bytecode.

Q43)What is CLI?

Ans) It is the main component of .net framework, It provide Hight Level language Interoperablity means, Application written on C# can easily by integrated with vb.net. This Target is achieved with the help of CLI (Common Language Infrasructure). It also describe the following four aspects.
CTS (Commong Type System).
Meta Data
CLS (Common Language Specification).
Virtual Execution System (VES)

Q44)What is CTS?

Ans) It provide you with the base set of data type, A data type define by CTS can use in any of .net framework language. Furthermore, Every thing in CTS is an object, means every data type is derived from System.object.

Q45)Any idea of aspnet_regiis?

Ans) It is used to register asp.net in IIS, it can be access from .net Command Prompt or .net framework Directory.

Q46)Any idea of ASP NET State Service?

Ans) Well, Asp.net State service is off by default but In windows 2003 it is installed by default. It is used to manage session State on a computer.

Q47)What is the difference between stroed procedure and stored function in SQL?

Ans) There are following basic difference between them
Function can return a table variable where as sp cannot.
T-SQl ignore error in Sp and proceed to next line where as function stops.
You Can use sp in XML For Clause , but Function can't be used there


Q48)Can we have an updateable view in SQL?

Ans) no , they are read only.

Q49)What is connection pooling? how can we acheive that in asp.net?

Ans) Well, there is a pool for database connections, the moment when we request for database connection ADO.net check if there is a recent connection in the pool with the same connectionString, If it find, it used that otherwise create a new connection.We can use connection Pooling in asp.net by System.Data.SqlClient.SqlConnectionPoolManager furthermore, We can define pooling attribute in connection string
pooling=false|True
Min Pool Size=50
Max Pool Size=600

Q50)What is DataSet?

Ans)Dataset is like a recordset, when we get any result from datasource, dataset fill it self with the result and destroy the connection from datasource. It is also called disconnected datasource. It remove the over head of maintaining connection with the database, but can make application slow where there is large sum of results.

Q51)What is the difference between typed and untyped dataset?

Ans) As the name mention, untyped dataset are not structured where as typed dataset are keenly structure.
We need to do some extra coding but by that we can make our code look pretty and understandable.

Q52)What is the difference bewteen accessing the data throgh the dataset and datareader?

Ans)Dataset doesnot maintain connection with the datasource where as in data reader we explisitly need to close the connection. where as datareader is forward only and we have not such restriction in dataset.