You are on page 1of 8

1. What exception can an overridden method throw in comparison with the method it is overriding? 2. What does parseQueryString return?

3. Anonymous classes ? Can they have constructors? 4. what is wrong with this abstract class MyClass { transient a, synchronized b. } 5. How can an inner class access the members of outer class? 6. Find the output: String a=?abc?; String b=?abc?; If(a==b) System.out.println(?1?); Else System.out.println(?2?); If a.equals(b) System.out.println(?3?); Else System.out.println(?4?); 7. Find the output Code showing Call by reference and call by value was given Array was used. 8. once Some For stmts was given Mark all valid

9. byte b=1 While(++b > 0); System.out.println(b); ASP.NET 3.5 Interview Questions & Answers : 1. Explain the life cycle of an ASP .NET page.? Following are the events occur during ASP.NET Page Life Cycle: 1)Page_PreInit 2)Page_Init 3)Page_InitComplete 4)Page_PreLoad 5)Page_Load 6)Control Events 7)Page_LoadComplete 8)Page_PreRender

9)SaveViewState 10)Page_Render 11)Page_Unload Among above events Page_Render is the only event which is raised by page. So we can't write code for this event. 2. how does the cookies work in asp.net? we know Http is an state-less protocol which is required for interaction between clinet and server . so there is an need to remeber state of request raised by an web browser so that web server can recognize you have already previously visited or not. There are two types of state management techniques: a) Client side state management b) Server - side statemanagement Using cookies comes under clinet side statemanagement .In HttpResponse we write Cookie containing sessionId and other information within it. when a browser made a request to the web server the same cookie is sent to the server where server recognize the session id and get other information stored to it previously. 3. What is Ispostback method in ASP.Net? Why do we use that?? Basically Post back is an action performed by a interactive Webpage. When it goes to the server side for a non-client Operation Server again posts it back to the client and hence the name. Ex: if(!IsPostBack) will not allow the page to post back again n again bcoz it reduces the performance. 4. Can User Control be stored in library?. I will say "NO" there are 3 types of controls: 1) User Control 2) Custom Control 3) Web parts you can reuse User control in the current project in which you have built it, but you can't move it to other project as unless you just copy paste the same file there and make the changes for that project ( which violets the concept of library). but custom control can be shared between projects. and you can precompile them even as a dll, so this means you can use them in library of any type. 5. what is the difference between application state and caching? Application Object and Cached Object both falls under Server side State Management.

Application object resides in InProc i.e. on the same server where we hosted our application. Cache Object resides on server side/ DownStream/Client Side. Application Object will be disposed once application will stop. Cache Object can be disposed using Time based cache dependency. Only one user can access Application Object at a time hence we have to lock it every time we modify it. 6. what is boxing and unboxing? Boxing is what happens when a value-type object is assigned to a reference-type variable. Unboxing is what happens when a reference-type variable is assigned to a value-type variable. 7. What are the uses of Reflection?? Reflection is a concept using which we can 1) Load assemblies dynamically 2) Invoke methods at runtime 3) Retriving type information at runtime. po8. What is the use of AutoWireup in asp.net? AutoEventWireup attribute is used to set whether the events needs to be automatically generated or not. In the case where AutoEventWireup attribute is set to false (by default) event handlers are automatically required for Page_Load or Page_Init. However when we set the value of the AutoEventWireup attribute to true the ASP.NET runtime does not require events to specify event handlers like Page_Load or Page_Init. 9. what events will occur when a page is loaded? Below are the events occures during page load. 1) Page_PreInit 2) Page_Init 3) Page_InitComplete 4) Page_PreLoad 10. Where is the View state Data stored? ViewState data is stored in the hidden field. When the page is submitted to the server the data is sent to the server in the form of hidden fields for each control. If th viewstate of the control is enable true the value is retained on the post back to the client when the page is post backed. 11. What is the difference between custom web user control and a custom web server control? Web User Control: 1) Easy to Create. 2) It Can be used inside the same Application.(To use it in other application we need to add it to that project.) 3) It Can take advantage of Caching Technique.

Web Server Control: 1) Bit tuff to create as compare to User Control. 2) Easy to use. 3) Can be added to ToolBox. 12. Where do the Cookie State and Session State information be stored? Cookie Information will be stored in a txt file on client system under a folder named Cookies. Search for it in your system you will find it. Coming to Session State As we know for every process some default space will be allocated by OS. In case of InProc Session Info will be stored inside the process where our application is running. In case of StateServer Session Info will be stored using ASP.NET State Service. In case of SQLServer Session info will be stored inside Database. Default DB which will be created after running InstallSQLState Script is ASPState. 13. What is the difference between adding reference in solution Explorer and adding references by USING ? Adding reference in solution explorer is used to add the DLL for that project for reference only. If you want to utilize that DLL methods/functions in our aspx.cs/.cs file etc you must write using that nameclass library name in file. 14. What are the different types of sessions in ASP.Net? Name them.? Session Management can be achieved in two ways 1)InProc 2)OutProc OutProc is again two types 1)State Server 2)SQL Server InProc Adv.: 1) Faster as session resides in the same process as the application 2) No need to serialize the data DisAdv.: 1) Will degrade the performance of the application if large chunk of data is stored 2) On restart of IIS all the Session info will be lost State Server Adv.: 1) Faster then SQL Server session management 2) Safer then InProc. As IIS restart won't effect the session data DisAdv.: 1) Data need to be serialized 2) On restart of ASP.NET State Service session info will be lost 3)Slower as compared to InProc SQL Server Adv.: 1) Reliable and Durable 2) IIS and ASP.NET State Service

restart won't effect the session data 3) Good place for storing large chunk of data DisAdv.: 1) Data need to be serialized 2) Slower as compare to InProc and State Server 3)Need to purchase Licensed version of SQL Serve 15. How do you design a website with multilingual support in ASP.NET? Multilingual website can be created using Globalization and Localization. Using Globalization we change the Currency Date Numbers etc to Language Specific Format. To change the string which is there in the label button etc to language specific string we use Localization. In Localization we have to create different Resource files for different languages. During this process we use some classes present in System.Resources System.Globalization System.Threading namespaces. 16. What is caching? What are different ways of caching in ASP.NET? Caching is a technique of persisting the data in memory for immediate access to requesting program calls. This is considered as the best way to enhance the performance of the application. Caching is of 3 types: Output Caching - Caches the whole page. Fragment Caching - Caches a part of the page Data Caching - Caches the data 17. What is meant by 3-tier architecture. We generally split our application into 3-Layers 1)Presentation Layer ( Where we keep all web forms Master Pages and User Controls). 2)Business Layer (Where we keep business logic). e.g Code related to manipulating data Custom Exception classes Custom Control classes Login related code if any etc. etc. 3)Data Access Layer (Where we keep code used to interact with DB). e.g. We can have the methods which are using SQL Helper (Application Block). 18. Explain the basic functionality of garbage collector? Garbage Collector in .Net Framework is used for Automatic Memory Management i.e. it is collect all unused memory area and give to application. system.gc.collect() is a method for release the memory. But remember one think it is only an request i.e. we can't explicitly release the memory by using system.gc.collect(). 19. What is the difference between mechine.config and web.config? machine.config is a system level configuration i.e it is applied on all application in o/s that the configuration is set where as in web.config it is applicable to only one application i.e each asp.net webapplication will contain atleast on web.config file. 20. How can exception be handled with out the use of try catch? using Exception Management application block or Page_error Application_error objects 21. What is the difference between Response.Redirect and Server.Transfer. Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser. This provides a faster response with a little less overhead on the server.Server.Transfer does not update the clients url history list or current url.

Response.Redirect is used toredirect the user's browser to another page or site. This performs a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address. 22. Where the assembly is stored in asp.net?. private are stored in application / bin directory and public are stored in GAC. 23. How we implement Web farm and Web Garden concept in ASP.NET?. A web farm is a multi-server scenario. So we may have a server in each state of US. If the load on one server is in excess then the other servers step in to bear the brunt. How they bear it is based on various models. 1. RoundRobin. (All servers share load equally) 2. NLB (economical) 3. HLB (expensive but can scale up to 8192 servers) 4. Hybrid (of 2 and 3). 5. CLB (Component load balancer). A web garden is a multi-processor setup. i.e. a single server (not like the multi server above). How to implement webfarms in .Net: Go to web.config and Here for mode you have 4 options. a) Say mode inproc (non web farm but fast when you have very few customers). b) Say mode StateServer (for webfarm) c) Say mode SqlServer (for webfarm) Whether to use option b or c depends on situation. StateServer is faster but SqlServer is more reliable and used for mission critical applications. How to use webgardens in .Net: Go to web.config and Change the false to true. You have one more attribute that is related to webgarden in the same tag called cpuMask. 24. Is there any limit for query string? means what is the maximum size?.. Servers should be cautious about depending on URI lengths above 255 bytes because some older client or proxy implementations may not properly support these lengths. Query string length depends on browser compatability IE supports upto 255 Firefox supports upto 4000 25. What is the exact purpose of http handlers? ASP.NET maps HTTP requests to HttpHandlers. Each HttpHandler enables processing of individual HTTP URLs or groups of URL extensions within an application. HttpHandlers have the same functionality as ISAPI extensions with a much simpler programming model Ex 1.Default HttpHandler for all ASP.NET pages ->ASP.NET Page Handler (*.aspx) 2.Default HttpHandler for all ASP.NET service pages->ASP.NET Service Handler (*.asmx) An HttpHandler can be either synchronous or asynchronous. A synchronous handler does not return until it finishes processing the HTTP request for which it is called. An asynchronous handler usually launches a process that can be lengthy and returns before that process finishes After writing and compiling the code to implement an HttpHandler you must register the handler using your application's Web.config file. Top of Form Bottom of Form What is Microsoft SharePoint Portal Server?

SharePoint Portal Server is a portal server that connects people, teams, and knowledge across business processes. SharePoint Portal Server integrates information from various systems into one secure solution through single sign-on and enterprise application integration capabilities. It provides flexible deployment and management tools, and facilitates end-to-end collaboration through data aggregation, organization, and searching. SharePoint Portal Server also enables users to quickly find relevant information through customization and personalization of portal content and layout as well as through audience targeting. What is Microsoft Windows SharePoint Services? Windows SharePoint Services is the solution that enables you to create Web sites for information sharing and document collaboration. Windows SharePoint Services " a key piece of the information worker infrastructure delivered in Microsoft Windows Server 2003 " provides additional functionality to the Microsoft Office system and other desktop applications, and it serves as a platform for application development. Office SharePoint Server 2007 builds on top of Windows SharePoint Services 3.0 to provide additional capabilities including collaboration, portal, search, enterprise content management, business process and forms, and business intelligence. What are the advantages of jQuery The advantages of using jQuery are: 1. JavaScript enhancement without the overhead of learning new syntax 2. Ability to keep the code simple, clear, readable and reusable 3. Eradication of the requirement of writing repetitious and complex loops and DOM scripting library calls What is JQuery JQuery is a light weight JavaScript library which provides fast and easy way of HTML DOM traversing and manipulation, its event handling, its client side animations, etc. One of the greatest features of jQuery is that jQuery supports an efficient way to implement AJAX applications because of its light weight nature and make normalize and efficient web programs. The IHttpHandler and IHttpHandlerFactory interfaces ? The IHttpHandler interface is implemented by all the handlers. The interface consists of one property called IsReusable. The IsReusable property gets a value indicating whether another request can use the IHttpHandler instance. The method ProcessRequest() allows you to process the current request. This is the core place where all your code goes. This method receives a parameter of type HttpContext using which you can access the intrinsic objects such as Request and Response. The IHttpHandlerFactory interface consists of two methods GetHandler and ReleaseHandler. The GetHandler() method instantiates the required HTTP handler based on some condition and returns it back to ASP.NET. The ReleaseHandler() method allows the factory to reuse an existing handler. Does .NET CLR and SQL SERVER run in different process? Dot Net CLR and all .net realtes application and Sql Server run in same process or we can say that that on the same address because there is no issue of speed because if these two process are run in different process then there may be a speed issue created one process goes fast and other slow may create the problem. What do you mean by three-tier architecture? The three-tier architecture was comes into existence to improve management of code and contents and to improve the performance of the web based applications. There are mainly three layers in three-tier architecture. the are define as follows (1)Presentation (2)Business Logic (3)Database

(1)First layer Presentation contains mainly the interface code, and this is shown to user. This code could contain any technology that can be used on the client side like HTML, JavaScript or VBScript etc. (2)Second layer is Business Logic which contains all the code of the server-side .This layer have code to interact with database and to query, manipulate, pass data to user interface and handle any input from the UI as well. (3)Third layer Data represents the data store like MS Access, SQL Server, an XML file, an Excel file or even a text file containing data also some additional database are also added to that layers. When not to use Design Patterns Do not use design patterns in any of the following situations. When the software being designed would not change with time. When the requirements of the source code of the application are unique. If any of the above applies in the current software design, there is no need to apply design patterns in the current design and increase unnecessary complexity in the design.

You might also like