Monday, November 2, 2009

ASP .Net Interview Question

csharpwithdj.blogspot.com

1.What are steps in an asp .net page lifecycle?


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.

2.What is the main difference between Response.Write() and Response.Output.Write()?

With Response.Outout.Write options are available to you to write the formatted out put.

3.When implementing classes what are the specifics of an abstract method?

An Abstract method does not provide any implementation. The class containing it can not be instantiated it must be inherited. The deriving class must override abstract methods declared in parent class, unless it is an abstract class it self.

4.List all Validation Controls available in asp .net?

RequiredFieldValidator : Checks if a control has a value.

RangeValidator : Checks if the control’s value is within a certain range.

RegularExpressionValidator : Checks whether the value of an input control matches a certain pattern

CompareValidator : Checks a control’s value against a constant or another control value.

CustomValidator : Checks a control’s value against a customized validation logic.

ValidationSummary : Displays a list of all validation errors

5.What data types do the RangeValidator control support?

Integer, String, and Date.

6.Is C# .net case sensitive?

Yes it is.

7.What is the difference between a class and struct ?

A struct is a value type while a class is a reference type. There’s no inheritance with struct.


8.When passing a variable by reference to a method what is the difference between keywords ref and out?

When using the key word ref the variable must be initialize before calling the method,

while initialization is not mandatory when using out.

9.What are specifics for Static class?

Static class is implemented with the Keyword Static in the class definition.

It must contain only static members and methods. Public members of static class can be accessed without the class instantiation. Static class are sealed by default therefore can not be inherited. Static class cannot be instantiated.

10.What part of the code is usually called Code-Behind?

The Server side code is usually called Code-behind as reference to the fact that in a web application it is actually the part of the code handling the large part of the execution.

11.What part of the code is called Inline Code?

The asp .net client side code is usually call inline code. From most browsers it can be

view by choosing 'View source' from the page menu.

12.What is the difference between doing a Dataset.Clone() and Dataset.Copy()?

Dataset.Clone() will copy just the dataset structure including all the datatables,

schemas, relations and constraints; it will not copy the data. Dataset.Copy() will copy

both dataset structure and data.

13.What is the role of Global.asax file?

The Global.asax include its code behind file Global.asax.cs, it is use to implement

application and session level events.

14.What utility is used to manually deploy an assembly?

The GacUtil is a utility tool that comes with visual studio, it is use to deploy an

assembly by adding it into the GAC(Global Assembly Cache).

Ex: Type at the command line prompt

C:\gacutil /i ASPMyComponent.dll

will install ASPMyComponent into the GAC

15.Define MSIL. How is it use in the .Net framework?

MSIL stand for Microsoft Intermediate Language. During the compilation process, code written in any .NET compatible languages(J#, C#, VB,C++) is converted into MSIL. MSIL then create a compatibility bridge among these language before execution by the virtual machine.

16. What are differences between ASP.Net and Classic ASP?

-ASP programming is based on scripting languages like Jscript or VBScript which evolves around a mixture of scripting and HTML. ASP .net is base on an advance structured compiled language.

-ASP .net gives the option of separating the code behind (compiled code) from the design code or client code (HTML).

-ASP .net with visual studio .net provides an advanced application and session state

management, while ASP performs poorly at providing it.

-ASP has a poor error handling capability compare to ASP .net which has it much completed and much advanced.

-ASP does not have a built-in mechanism for XML while ASP .net comes with a full XML capability support.

-ASP .net has a fully distributed data source support which is missing from classic ASP

17.What property is use to set alternate color scheme in a Repeater control?

AlternatingItemTemplate.

18.What is the base class for Web Forms?

The System.Web.UI.Page class.

19.What are the meaning of terms boxing and un-boxing?

Boxing: Implicit conversion of a value type into a reference type.

Un-Boxing: Explicit conversion of a reference type into a value type. Can also be call casting.

20.Give a brief description of how the heap and stack are managed in .Net.

Stack and heap are memory sections of the .net application. The CLR(Common Language Runtime) is in charge of managing those sections.

Value type variables are stored in the stack where storing order is Last in first out.

When a variable is out of scope it basically fall off the stack.

Refence type variable are stored on the heap where storing order is First in first out.

When a variable becomes out of scope it is mark for collection.

The GC(Garbage Collector) is the part of the CLR responsible for cleaning up the heap releasing resources occupied by Reference type variables.

21.What is the difference between login controls and Forms authentication?

Login control provides form authentication. If we implement for authentication through form authentication then we do it through code. On the other hand, login control allows the easy implementation...............
22.What is Fragment Caching in ASP.NET?

.Fragment caching allows to cache specific portions of the page rather than the whole page. It is done by implementing the page in different parts............

23.What is partial classess in .net?

When there is a need to keep the business logic separate from the User Interface or when there is some class which is big enough to have multiple number of developers............
24.Explain how to pass a querystring from an .asp page to aspx page.

.From HTML in asppage:Test Query String

From server side code: ...............
25.What is a ViewState?

.If a site happens to not maintain a ViewState, then if a user has entered some information in a large form with many input fields and the page is refreshes, then the values filled up in the form are lost...........

26.What is the difference between src and Code-Behind?

.With the ‘src’ attribute, the source code files are deployed and are compiled by the JIT as needed.

Though the code is available to everyone with an access to the server (NOT anyone on the web)................

27.What is the difference between URL and URI?

.A URL (Uniform Resource Locator) is the address of some resource on the Web. A resource is nothing but a page of a site. There are other type of resources than Web pages, but that's the easiest conceptually...........

28.What is the Pre-Compilation feature of ASP.NET 2.0?

.Previously, in ASP.NET, the pages and the code used to be compiled dynamically and then cached so as to make the requests to access the page extremely efficient............

29.How can we create custom controls in ASP.NET?

.Custom controls are user defined controls. They can be created by grouping existing controls, by deriving the control from System.Web.UI.WebControls..........

30.What is an application domain?

.It's a way in CLR to maintain a boundary between various applications to ensure that they do not interfere in working of any other application...........

31.Explain the two different types of remote object creation mode in .NET. [Hint SAO and CAO]

.SAO Server Activated Object (call mode): lasts the lifetime of the server. They are activated as SingleCall/Singleton objects. It makes objects stateless...........

32.Describe SAO architecture of Remoting.

.Remoting has at least three sections:-

1. Server

2. Client: This connects to the hosted remoting object

3. Common Interface between client and the server .i.e. the channel..........

33.Explain Singleton architecture of Remoting.

.Singleton architecture is to be used when all the applications have to use or share same data...........

34.Define LeaseTime, SponsorshipTime, RenewOnCallTime, LeaseManagePollTime.

.The LeaseTime property protects the object so that the garbage collector does not destroy it as remoting objects are beyond the scope of the garbage collector. Every object created has a default leasetime for which it will be activated..........

35.Briefly explain how to specify remoting parameters using config files.

.The remoting parameters can be specified through both programming and in config files. All the settings defined in config files are placed under ...........

36.What is marshalling? Explain types of marshalling.

.Marshaling is a process of transforming or serializing data from one application domain and exporting it to another application domain...........

37.What is ObjRef object in remoting?

.ObjRef is a searializable object returned by Marshal() that knows about location of the remote object, host name, port number, and object name........

38.Explain the steps of acquiring a proxy object in web services.

.Every service listed has a URI pointing to the service's DISCO or WSDL document, which is needed to access the webservice and its 'webmethod" methods..........

39.Explain the steps to create a web services and consume it.

.Create a new website by selecting "ASP.NET Web Site" and giving it a suitable name. service.cs file appears inside the solution with a default webmethod named as "HelloWorld()"........
40.Explain the difference between cache object and application object.

.Application Object: Application variable/object stores an Object with a scope of availability of the entire Application unless explicitly destroyed.............
41.What is Cache Callback in Cache?

.The cache object has dependencies e.g. relationships to the file it stores. Cache items remove the object when these dependencies change. As a work around we would need to simply execute a callback method............

42.What is Scavenging?

.A process where items are removed from cache in order to free the memory based on their priority. A property called "CacheItemPriority" is used to figure out the priority of each item inside the cache...........

43.Explain the types of Caching using Cache object of ASP.NET.

.Page output: Is used to fetch information or data at page level. It is best used when the site is mainly static. Used by declaring the output page directive............

44.Show with an example how to Cache different version of same page using ASP.NET Cache object.

.The ways to cache different versions on the same page using ASP.NET cache object is using OutputCache object............

45.Explain how to implement Fragment Cache.

.Fragment cache is to store user controls individually within a web form in cache instead of the whole webform as such. The idea is to simply have different cache parameters for different user controls.............

46.Explain the various modes of storing ASP.NET session.

.Types of sessions: InProc: The default way to use sessions. InProc is the fastest way to store and access sessions...........

47.What are the benefits and limitations of using hidden fields?

.Advantages: Easy to implement, Hidden fields are supported by all browsers, Enables faster access of information because data is stored on client side............

48.What are the benefits and limitations of using Hidden Frames?

.Advantages: Hidden frames allow you to cache more than one data field, The ability to cache and access data items stored in different hidden forms...........

49.What are benefits and limitations of using Cookies?

.Advantages: They are simple to use. Light in size, thus occupy less memory. Stores server information on client side. Data need not to be sent back to server........

50.What is QueryString and what are benefits and limitations of using querystring?

.Querystring is way to transfer information from one page to another through the URL........
51.What is Absolute and Sliding expiration in .NET?

.Absolute and sliding expiration are two Time based expiration strategies. Absolute Expiration: Cache in this case expires at a fixed specified date or time..............

52.Explain the concepts and capabilities of cross page posting.

.Cross-page posting is done at the control level. It is possible to create a page that posts to different pages depending on what button the user clicks on. It is handled by done by changing the postbackurl property of the controls..........

53.Explain how to access ViewState value of this page in the next page.

.PreviousPage property is set to the page property of the nest page to access the viewstate value of the page in the next page. Page poster = this.PreviousPage;..........

54.What is SQL Cache Dependency in ASP.NET?

.SQL Cache Dependency in ASP.NET: It is the mechanism where the cache object gets invalidated when the related data or the related resource is modified.........

55.Explain the concepts of Post Cache Substitution in .NET

.Post Cache Substitution: It works opposite to fragment caching. The entire page is cached, except what is to be kept dynamic. When [OutputCache] attribute is used, the page is cached............

56.Explain the use of localization and Globalization.

.Users of different countries, use different languages and others settings like currency, and dates. Therefore, applications are needed to be configurable as per the required settings based on cultures, regions, countries........

57.Explain the concepts of CODE Page approach. What are the disadvantages of this approach?

.Code Page was used before Unicode came into existence. It was a technique to represent characters in different languages..........

58.What are resource files and explain how do we generate resource files?

.Resource files are files in XML format. They contain all the resources needed by an application. These files can be used to store string, bitmaps, icons, fonts........
59.What are Satellite assemblies and how to generate Satellite assemblies?

.To support the feature of multiple languages, we need to create different modules that are customized on the basis of localization. These assemblies created on the basis of different modules are knows as satellite assemblies...........

60.Define AL.EXE and RESGEN.EXE.

.Al.exe: It embeds the resources into a satellite assembly. It takes the resources in .resources binary format.......

61.Explain the concepts of resource manager class.

.ResourceManager class: It provides convenient access to resources that are culture-correct. The access is provided at run time.........

62.What is Windows communication foundation, WCF?

.WCF is a framework that builds applications that can inter-communicate based on service oriented architecture consuming secure and reliable web services.............

63.Explain the important principle of SOA.

.A service-oriented architecture is collection of services which communicate with one another other......

64.Explain the components of WCF - Service class, Hosting environment, END point.

.WCF Service is composed of three components: Service class: It implements the service needed, Host environment: is an environment that hosts the developed service.............

65.Difference between WCF and Web Services.

.WCF can create services similar in concept to ASMX, but has much more capabilities. WCF is much more efficient than ASP.Net coz it is implemented on pipeline............

66.What are different bindings supported by WCF?

.BasicHttpBinding, WSHttpBinding, WSDualHttpBinding.......

67.What is duplex contract in WCF?

.Duplex contract: It enables clients and servers to communicate with each other. The calls can be initiated independently of the other one.............

68.Explain the different transaction isolation levels in WCF.

.Read Uncommitted: - Also known as Dirty isolation level. It makes sure that corrupt Data cannot be read. This is the lowest isolation level............

69.What are Volatile and Dead letter queues?

.Volatile Queues: There are scenarios in the project when you want the message to deliver in proper time. The timely delivery of message is very more important and to ensure they are not lost is important too. Volatile queues are used for such purposes.............

70.What is Windows workflow foundation?

.Windows Workflow Foundation (WF): It is a platform for building, managing and executing workflow-enabled applications, for designing and implementing a programming model ..........

71.Explain the types of Workflow in Windows Workflow Foundation.

.There are 3 types of workflows in WWF: Sequential Workflow: The sequential workflow style executes a set of contained activities in order, one by one and does not provide an option to go back to any step...........

72.What are XOML files? Explain their uses.

.XOML is an acronym for Extensible Object Markup Language. XOML files are the markup files. They are used to declare the workflow and are then compiled with the file containing the implementation logic..............





No comments: