Your Ad Here

Sunday, January 11, 2009

Difficult Interview Questions - ASP.NET

Q. Explain what a diffgram is, and a good use for one?
A : The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.

Q.Whats MSIL, and why should my developers need an appreciation of it if at all?
A : MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.

Q.Which method do you invoke on the DataAdapter control to load your generated dataset with data?


A : The Fill() method.

Q.Can you edit data in the Repeater control?
A : No, it just reads the information from its data source.

Q.Which template must you provide, in order to display data in a Repeater control?
A : ItemTemplate.

Q.How can you provide an alternating color scheme in a Repeater control?
A : Use the AlternatingItemTemplate.

Q.What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?

A : You must set the DataSource property and call the DataBind method.

Q.What base class do all Web Forms inherit from?
A : The Page class.

Q.Name two properties common in every validation control?
A : ControlToValidate property and Text property.

Q.Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?

A : DataTextField property.

Q.Which control would you use if you needed to make sure the values in two different controls matched?

A : CompareValidator control.

Q.How many classes can a single .NET DLL contain?
A : It can contain many classes.

Q. What is ViewState?
A : ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used to retain the state of server-side objects between post backs.

Q.What is the lifespan for items stored in ViewState?
A : Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).

Q.What does the "EnableViewState" property do? Why would I want it on or off?
A : It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. When the page is posted back to the server the server control is recreated with the state stored in viewstate.

Q.What are the different types of Session state management options available with ASP.NET?

A : ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.

Q.What is CLS (Common Language Specificaiton)?
A : It provides the set of specificaiton which has to be adhered by any new language writer / Compiler writer for .NET Framework. This ensures Interoperability. For example: Within a ASP.NET application written in C#.NET language, we can refer to any DLL written in any other language supported by .NET Framework. As of now .NET Supports around 32 languages.

Q.What is CTS (Common Type System)?
A : It defines about how Objects should be declard, defined and used within .NET. CLS is the subset of CTS.

Q.What is Boxing and UnBoxing?
A : Boxing is implicit conversion of ValueTypes to Reference Types (Object). UnBoxing is explicit conversion of Reference Types (Object) to its equivalent ValueTypes. It requires type-casting.

Q.What is the difference between Value Types and Reference Types?
A : Value Types uses Stack to store the data where as the later uses the Heap to store the data.

Q.What are the different types of assemblies available and their purpose?
A : Private, Public/shared and Satellite Assemblies.
Private Assemblies : Assembly used within an application is known as private assemblies.
Public/shared Assemblies : Assembly which can be shared across applicaiton is known as shared assemblies. Strong Name has to be created to create a shared assembly. This can be done using SN.EXE. The same has to be registered using GACUtil.exe (Global Assembly Cache).

Satellite Assemblies : These assemblies contain resource files pertaining to a locale (Culture+Language). These assemblies are used in deploying an Gloabl applicaiton for different languages.

Q.What is view state and use of it?
A : The current property settings of an ASP.NET page and those of any ASP.NET server controls contained within the page. ASP.NET can detect when a form is requested for the first time versus when the form is posted (sent to the server), which allows you to program accordingly.



Q.What are user controls and custom controls?
A : Custom controls: A control authored by a user or a third-party software vendor that does not belong to the .NET Framework class library. This is a generic term that includes user controls. A custom server control is used in Web Forms (ASP.NET pages). A custom client control is used in Windows Forms applications.User Controls: In ASP.NET: A user-authored server control that enables an ASP.NET page to be re-used as a server control. An ASP.NET user control is authored declaratively and persisted as a text file with an .ascx extension. The ASP.NET page framework compiles a user control on the fly to a class that derives from the System.Web.UI.UserControl class.

Q.What are the validation controls?
A : set of server controls included with ASP.NET that test user input in HTML and Web server controls for programmer-defined requirements. Validation controls perform input checking in server code. If the user is working with a browser that supports DHTML, the validation controls can also perform validation using client script.

Q.. What's the difference between Response.Write() andResponse.Output.Write()?
A : The latter one allows you to write formattedoutput.

Q.What methods are fired during the page load?

A : Init()
When the page is instantiated, Load() - when the page is loaded into server memory,PreRender () - the brief moment before the page is displayed to the user as HTML, Unload() - when page finishes loading.

Q.Where does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page

Q.Where do you store the information about the user's locale?
System.Web.UI.Page.Culture

Q.What's the difference between Codebehind="MyCode.aspx.cs" and Src="MyCode.aspx.cs"?
A : CodeBehind is relevant to Visual Studio.NET only.

Q.What's a bubbled event?
A : When you have a complex control, likeDataGrid, writing an event processing routine for each object (cell, button,row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents. Suppose you want a certain ASP.NET function executed on MouseOver over a certain button.

0 comments:

Your Ad Here