Tuesday, October 27, 2009

ASP.NET Interview Questions

ASP.NET Interview Questions
  1. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
    inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.
  2. What’s the difference between Response.Write() andResponse.Output.Write()?
    Response.Output.Write() allows you to write formatted output.
  3. What methods are fired during the page load?
    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.
  4. When during the page processing cycle is ViewState available?
    After the Init() and before the Page_Load(), or OnLoad() for a control.
  5. What namespace does the Web page belong in the .NET Framework class hierarchy?
    System.Web.UI.Page
  6. Where do you store the information about the user’s locale?
    System.Web.UI.Page.Culture
  7. What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
    CodeBehind is relevant to Visual Studio.NET only.
  8. What’s a bubbled event?
    When you have a complex control, like DataGrid, 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.
  9. Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?
    Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");
  10. What data types do the RangeValidator control support?
    Integer, String, and Date.
  11. Explain the differences between Server-side and Client-side code?
    Server-side code executes on the server. Client-side code executes in the client's browser.
  12. What type of code (server or client) is found in a Code-Behind class?
    The answer is server-side code since code-behind is executed on the server. However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code.
  13. Should user input data validation occur server-side or client-side? Why?
    All user input data validation should occur on the server at a minimum. Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.
  14. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
    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 to redirect the user's browser to another page or site. This performas 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.
  15. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
    Valid answers are:
    ·
    A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
    · A DataSet is designed to work without any continuing connection to the original data source.
    · Data in a DataSet is bulk-loaded, rather than being loaded on demand.
    · There's no concept of cursor types in a DataSet.
    · DataSets have no current record pointer You can use For Each loops to move through the data.
    · You can store many edits in a DataSet, and write them to the original data source in a single operation.
    · Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
  16. What is the Global.asax used for?
    The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.
  17. What are the Application_Start and Session_Start subroutines used for?
    This is where you can set the specific variables for the Application and Session objects.
  18. Can you explain what inheritance is and an example of when you might use it?
    When you want to inherit (use the functionality of) another class. Example: With a base class named Employee, a Manager class could be derived from the Employee base class.
  19. Whats an assembly?
    Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN
  20. Describe the difference between inline and code behind.
    Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.
  21. Explain what a diffgram is, and a good use for one?
    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.
  22. Whats MSIL, and why should my developers need an appreciation of it if at all?
    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.
  23. Which method do you invoke on the DataAdapter control to load your generated dataset with data?
    The Fill() method.
  24. Can you edit data in the Repeater control?
    No, it just reads the information from its data source.
  25. Which template must you provide, in order to display data in a Repeater control?
    ItemTemplate.
  26. How can you provide an alternating color scheme in a Repeater control?
    Use the AlternatingItemTemplate.
  27. 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?
    You must set the DataSource property and call the DataBind method.
  28. What base class do all Web Forms inherit from?
    The Page class.
  29. Name two properties common in every validation control?
    ControlToValidate property and Text property.
  30. 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?
    DataTextField property.
  31. Which control would you use if you needed to make sure the values in two different controls matched?
    CompareValidator control.
  32. How many classes can a single .NET DLL contain?
    It can contain many classes.

Web Service Questions

  1. What is the transport protocol you use to call a Web service?
    SOAP (Simple Object Access Protocol) is the preferred protocol.
  2. True or False: A Web service can only be written in .NET?
    False
  3. What does WSDL stand for?
    Web Services Description Language.
  4. Where on the Internet would you look for Web services?
    http://www.uddi.org/
  5. True or False: To test a Web service you must create a Windows application or Web application to consume this service?
    False, the web service comes with a test page and it provides HTTP-GET method to test.

State Management Questions

  1. What is ViewState?
    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 the retain the state of server-side objects between postabacks.
  2. What is the lifespan for items stored in ViewState?
    Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).
  3. What does the "EnableViewState" property do? Why would I want it on or off?
    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.
  4. What are the different types of Session state management options available with ASP.NET?
    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
source : http://blogs.crsw.com

10 Tips for Project Success

1. Starting out: Make sure that when you start out your customer defines their requirements in depth. You need to know exactly what it is that must be delivered, to who and when. Make it specific, write it up formally and get them to sign it off. This document will become the basis upon which to measure your success.

2. Customers: Involve your customers throughout the entire project life cycle. Get them involved in the analysis and planning, as well as execution. You don't have to seek their approval, just keep them informed. The more you involve them, the greater their level of buy-in and the easier it is to manage their expectations.

3. Timeframes: Keep your delivery timeframes short and realistic. Never agree to lengthy timeframes. Split the project into "mini-projects" if you need to. Keep each mini-project to less than 6 months. This keeps everyone motivated and focused.

4. Milestones: Break your project timeframe into "Milestones" which are manageable pieces of work. Add delivery deadlines to your milestones and try to deliver on every deadline, no matter what. If you're late, tell your customer about it as early as possible.

5. Communications: Make sure you keep everyone informed by providing the right information at the right time. Produce Weekly Status Reports and run regular team meetings. Use “Project Management Templates” to save you time.

6. Scope: Only authorize changes to your project scope if there is no impact on the timeline. Get your customers approval to important scope changes first and then get their buy-in to extend the delivery dates if you need to.

7. Quality: Keep the quality of your deliverables as high as possible. Constantly review quality and never let it slip. Implement "peer reviews" so that team members can review each others deliverables. Then put in place external reviews to ensure that the quality of the solution meets your customer's needs.

8. Issues: Jump on risks and issues as soon as they are identified. Prioritize and resolve them before they impact on your project. Take pride in keeping risks and issues to a minimum.

9. Deliverables: As each deliverable is complete, hand it formally over to your customer. Get them to sign an Acceptance Form to say that it meets their expectations. Only then can you mark each deliverable off as 100% complete.

10. Your team: Great projects are run by great teams. Hire the best people you can afford. Spend the time to find the right people. It will save you time down the track. Remember, good people are easy to motivate. Show them the vision and how they can make it happen. Trust and believe in them. Make them feel valued. They will work wonders.

Debugging - A Important Aspect in Programming

Debugging - A Important Aspect in Programming

In this tutorial you will learn about Debugging - A Important Aspect in Programming, Detection or Finding of the Bug, What the bug or fault is, Where it has occurred, How it is caused, Important Factors to Consider while debugging, Debuggers utilities and functions - Step-By-Step, Breakpoint.

After developing a program the next step is to test the program to find whether the program function and produces output as desired. In real situations the program when run immediately after developed will give errors of different types say syntax errors or logical errors and so on. This is where debugging terminology figures out. Debugging is the step by step process of finding errors or bugs in a program so that the bugs can be removed to make the program function in the way it was desired. There are several tools available to do the above defined debugging process. These tools are called debuggers.

As we have seen debugging process involves the identification of bug in a procedural way the sub events involved in this debugging process are namely:

Detection or Finding of the Bug:

This is the primary process or activity of a debugging process. For doing this with key attention the output or the value at each stage of the module or program must be checked. If any discrepancy is found then with greater attention that sub portion must be checked to find the values passed to each variables and the output that occurs from each process in that subdivision. One can also add some temporary statements or print or output statements for checking the values of variables. These temporary statements must be removed carefully after the debugging process. In some cases it may be necessary to recreate the bug to identify where it has occurred. Thus the main idea of this step of debugging process is to identify

What the bug or fault is – This can be done by recreation of bugs or by careful checking of values

Where it has occurred – By writing temporary print or output statements or finding the place where value is changed or reasons why data is not in proper format and so on.

How it is caused and so on.


Having done the major process of debugging the next step in debugging is to fix the error or bug.

Bug Fixing or Error Correction: This is also involved in the process of debugging because while we fix an error or bug there is possibility that it may give raise to some other bugs. If it happens again the process mentioned above namely detection, correction takes place. This continues until the system is found to be bug free.

Important Factors to Consider while debugging

· While correcting or fixing a bug always make it a habit to make comments containing description about date, purpose of fixing, username who fixed the bug and so on. This is very essential because this will be helpful if the person who made the bug fixing later on want to refer the bug for some reason for fixing some other fix or it would be helpful for other users since it act as a documentation which provides an easy reference.

· Make it a practice that while debugging to make a change and test it immediately. This is because when a change is made to the existing code it may pave way for some more bugs. After ensuring that the corresponding fix works fine by testing then go for next change. In other words it is essential to be systematic in approach while debugging..

· It is very essential to remove the temporary code added just for debugging purposes like temporary print statement to check the value of variables and so on.

· When a fault is found in debugging process after correcting and fixing it always have a broader vision and think whether the same fault or similar situations can occur in other parts of the program. This vision will help in reducing the time in debugging process. .

· While debugging it is always good to follow the modular approach. Since by viewing details in module level greater details and bugs can be detected if any existing and also correction of bugs becomes easier at the modular level and proceed as such to different modules and then proceed to interfaces between modules. .

· Before starting the process of debugging it is good to have an overview of what the program or modules is about and prepare a step by step approach. This process though takes time will help in proceeding systematically in debugging process and helps while the debugging is going on.
.

· First a step-by-step eye viewing manually on the program or module is needed to find what happens to value of variables and to decide whether any temporary statement needs to be inserted. After this if the process is complex debugging tools or symbolic debuggers etc can be used for debugging process.

Having known a lot about the concept of debugging now let us see how to do this process of debugging in a simplier and efficient way. This is done by the use of debuggers

Debuggers have many utilities and functions in it to name a few are

Step-By-Step – It helps watching the variables or value of the program in each step and therefore thorough analysis can be made easily.

Breakpoint – This is used for pause the program at any time needed. Say for instance if a user wants to check the value written in a file when enter key is pressed then after enter key is pressed if this breakpoint is used then program is paused and the user could check the file.

The above mentioned is only a few of the numerous abilities or functions available while debugging using debugging tools. Whatever may the tool used it is important that one should definitely debug their program or in other words it is vital to follow the debugging step in software development life cycle in order have a quality product.

Software Development Life Cycle

The product developed which achieves customer satisfaction is not done in a single step. It involves series of steps in a software development process. This is needed to develop quality products with error free products to achieve customer satisfaction. There are many models available in the software development process.

But majority of software development process follow the model named as software development life cycle. This software develop life cycle has number of steps in it. The below article describes about the software development life cycle and the steps involved into it.

Software development life cycle model is also called as waterfall model which is followed by majority of systems. This software development life cycle process has the following seven stages in it namely


1. System Requirements Analysis
2. Feasibility study
3. Systems Analysis and Design
4. Code Generation
5. Testing
6. Maintenance
7. Implementation

Let us discuss each of these to have an overview about teach of the following steps in software development life cycle.

1. System Requirements Analysis:
The first essential or vital thing required for any software development is system. Also the system requirement may vary based on the software product that is going to get developed. So a careful analysis has to be made about the system requirement needed for the development of the product. After the analysis and design of the system requirement phase the system required for the development would be complete and the concentration can be on the software development process.

2. Feasibility study:
After making an analysis in the system requirement the next step is to make analysis of the software requirement. In other words feasibility study is also called as software requirement analysis. In this phase development team has to make communication with customers and make analysis of their requirement and analyze the system. By making analysis this way it would be possible to make a report of identified area of problem. By making a detailed analysis on this area a detailed document or report is prepared in this phase which has details like project plan or schedule of the project, the cost estimated for developing and executing the system, target dates for each phase of delivery of system developed and so on. This phase is the base of software development process since further steps taken in software development life cycle would be based on the analysis made on this phase and so careful analysis has to be made in this phase.

3. Systems Analysis and Design:
This is an important phase in system development .Here analysis is made on the design of the system that is going to be developed. In other words database design, the design of the architecture chosen, functional specification design, low level design documents, high level design documents and so on takes place. Care must be taken to prepare these design documents because the next phases namely the development phase is based on these design documents. If a well structured and analyzed design document is prepared it would reduce the time taken in the coming steps namely development and testing phases of the software development life cycle.

4. Code Generation:
This is the phase where actual development of the system takes place. That is based on the design documents prepared in the earlier phase code is written in the programming technology chosen. After the code is developed generation of code also takes place in this phase. In other words the code is converted into executables in this phase after code generation.

5. Testing:
A software or system which is not tested would be of poor quality. This is because this is the phase where system developed would be tested and reports are prepared about bugs or errors in system. To do this testing phase there are different levels and methods of testing like unit testing, system test and so on. Based on the need the testing methods are chosen and reports are prepared about bugs. After this process the system again goes to development phase for correction of errors and again tested. This process continues until the system is found to be error free. To ease the testing process debuggers or testing tools are also available.