Saturday, July 5, 2008

ASP.Net Basic Interview questions and answers

1. Explain the differences between Server-side and Client-side code?
Server side code is executed at server(Like vbscript)
Client side code is executed at client(like javascript)

2. What type of code (server or client) is found in a Code-Behind

Server side

3. Should validation (did the user enter a real date) occur
server-side or client-side? Why?

It occurs on Client-side (we should not validate at server round trip is wasted)

4. What does the "EnableViewState" property do? Why would I want it on or off?

EnableViewState enable to maintain the state of servercontrols

5. What is the difference between Server.Transfer and
Response.Redirect? Whywould I choose one over the other?

Server.Transfer is which transfers execution of one page.
Response.Redirect makes the browser to rqeust the specified page which wastes round-trip from
server- browser -server.

prefer server.transfer.

8. Can you explain the difference between an ADO.NET Dataset and an
ADO Recordset?

Ado Record set consists of records(Rows) and fields(columns)
An ADO.NET DataSet contains a collection of zero or more tables represented by DataTable objects.
The DataSet is the core component of the disconnected architecture of ADO.NET. The DataSet is explicitly designed for data access independent of any data source. As a result it can be used with multiple and differing data sources, XML data, or used to manage data local to the application. The DataSet contains a collection of one or more DataTable objects made up of rows and columns of data, as well as primary key, foreign key, constraint and relation information about the data in the DataTable objects.
ADO.NET is an evolutionary improvement to Microsoft ActiveX Data Objects (ADO). It is a standards-based programming model for creating distributed, data-sharing applications.

9. Can you give an example of what might be best suited to place in
the Application_Start and Session_Start subroutines?
Application_start is used to track the status of Application level
Session start is used to maintain status of each user.

11. What are ASP.NET Web Forms? How is this technology different than
what is available though ASP (1.0-3.0)?

Asp.Net webForms are Event-based programming model and not interperted

Asp is interpreter

12. How does VB.NET/C# achieve polymorphism?

overloading and overriding.

11. Can you explain what inheritance is and an example of when you
might use it?

when webform is created it is inherited from page.

15. Describe the difference between inline and code behind - which is
best in a loosely coupled solution
Inline code is written in .aspx page within the <% %> tags. This would run the page in an interpreted mode.
Code written in the Code-Behind Class would be run in a compiled mode. This is a better approach as the code would be separted from the interface elements.

20. What are the disadvantages of viewstate/what are the benefits
ViewState is maintained in an encoded format in the form of a hidden field in the web page. This is automatically decoded by and is used to retain the contents of the web controls on postback

21 Describe session handling in a webfarm, how does it work and what
are the limits
Using Session object to store the user state increases the load on the server as the state is maintained at the server. This would prove to be a burden on the server when the number of users accessing the site increase.
Also, in a web farm environment, multiple web servers are used to send data to the requesting user. In this case, since a Session is maintained at one web server, distributing the session information across multiple web servers is not viable.

23. Whats MSIL, and why should my developers need an appreciation of
it if at all?
Microsoft intermediate Language

24. In what order do the events of an ASPX page execute. As a developer is it important to undertsand these events? is event driven model.

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

26. Can you edit data in the Repeater control?
No. This control is used to display repeating data in a table

30. What base class do all Web Forms inherit from?

31. What method do you use to explicitly kill a user's session?

33. Which two properties are on every validation control?

Answer: 1 and 2

34. What tags do you need to add within the asp:datagrid tags to bind
columns manually?

35. How do you create a permanent cookie?
Reponse.Cookies("Cookiename") = "test"
Response.Cookies("Cookiename").Expires = Now() + 10 (Cookie expires in 10 years)

36. What tag do you use to add a hyperlink column to the DataGrid?

37. What is the standard you use to wrap up a call to a Web service
SOAP (simple object access protocol)

38. Which method do you use to redirect the user to another page
without performing a round trip to the client?

39. What is the transport protocol you use to call a Web service SOAP

41. What does WSDL stand for?
webservice description language

42. What property do you have to set to tell the grid which page to go
to when using the Pager object?

43. Where on the Internet would you look for Web services?
UDDI Universal Description Discovery And Integration registry

44. What tags do you need to add within the asp:datagrid tags to bind
columns manually.
Need to add template columns

45. 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?

46. How is a property designated as read-only?

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

48. True or False: To test a Web service you must create a windows
application or Web application to consume this service?

49. How many classes can a single .NET DLL contain?
Any number of classes

Additional questions:

- Briefly explain how code behind works and contrast that using the inline
- What are HTML controls, Web controls, and server controls.
- Briefly explain how the server control validation controls work.
- Briefly explain what user controls are and what server controls are and
the differences between the two.
- Briefly explain how server form post-back works (perhaps ask about view state as well).
- Can the action attribute of a server-side
tag be set to a value and if not how can you possibly pass data from a form page to a subsequent page. (Extra credit: Have you heard of comdna. :-)
- Briefly describe the role of global.asax.
- How would ASP and ASP.NET apps run at the same time on the same server?
- What are good ADO.NET object(s) to replace the ADO Recordset object.

10. Diff between Dataset and Datareader?
12. diff. betn Dataset and Recordset.
13. why Datareader is useful?
14. How do u call and execute a SP in .NET?
17. What r the ASP.NET list controls and diff. between them?
22. i've 2 buttons on an page(.aspx). i wanna execute same routine clicking on 2
27. What is Viewstate?

No comments: