找回密码
 FreeOZ用户注册
查看: 2930|回复: 6
打印 上一主题 下一主题

[职业发展] .net interview questions

[复制链接]
跳转到指定楼层
1#
发表于 30-5-2007 13:22:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?FreeOZ用户注册

x
Basic .NET and ASP.NET interview questions

Submitter said questions were asked in a US company hiring a Web developer.

   1. Explain the .NET architecture.

   2. How many languages .NET is supporting now? - When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net says 44 languages are supported.

   3. How is .NET able to support multiple languages? - a language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.

   4. How ASP .NET different from ASP? - Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.

   5. Resource Files: How to use the resource files, how to know which language to use?

   6. What is smart navigation? - The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

   7. What is view state? - The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control

   8. Explain the life cycle of an ASP .NET page.

   9. How do you validate the controls in an ASP .NET page? - Using special validation controls that are meant for this. We have Range Validator, Email Validator.

  10. Can the validation be done in the server side? Or this can be done only in the Client side? - Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.

  11. How to manage pagination in a page? - Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.

  12. What is ADO .NET and what is difference between ADO and ADO.NET? - ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.

评分

参与人数 1威望 +20 收起 理由
nana + 20 开始漫漫找工路……

查看全部评分

回复  

使用道具 举报

2#
 楼主| 发表于 30-5-2007 13:23:17 | 只看该作者
#
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.

# What’s the difference between Response.Write() andResponse.Output.Write()?
Response.Output.Write() allows you to write formatted output.

# 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.

# When during the page processing cycle is ViewState available?
After the Init() and before the Page_Load(), or OnLoad() for a control.

# What namespace does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page

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

# What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
CodeBehind is relevant to Visual Studio.NET only.

# 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.

# 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();");

# What data types do the RangeValidator control support?
Integer, String, and Date.

# 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.

# 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.

# 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.

# 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.

# 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.

# 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.

# 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.

# 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.

# Whats an assembly?
Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN

# 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.

# 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.

# 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.

# Which method do you invoke on the DataAdapter control to load your generated dataset with data?
The Fill() method.

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

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

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

# 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.

# What base class do all Web Forms inherit from?
The Page class.

# Name two properties common in every validation control?
ControlToValidate property and Text property.

# 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.

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

# How many classes can a single .NET DLL contain?
It can contain many classes.
回复  

使用道具 举报

3#
 楼主| 发表于 30-5-2007 13:33:31 | 只看该作者
*  From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?

    * What are ASHX files?  What are HttpHandlers?  Where can they be configured?

    * What is needed to configure a new extension for use in ASP.NET? For example, what if I wanted my system to serve ASPX files with a *.jsp extension?

    * What events fire when binding data to a data grid? What are they good for?

    * Explain how PostBacks work, on both the client-side and server-side. How do I chain my own JavaScript into the client side without losing PostBack functionality?

    * How does ViewState work and why is it either useful or evil?

    * What is the OO relationship between an ASPX page and its CS/VB code behind file in ASP.NET 1.1? in 2.0?

    * What happens from the point an HTTP request is received on a TCP/IP port up until the Page fires the On_Load event?

    * How does IIS communicate at runtime with ASP.NET?  Where is ASP.NET at runtime in IIS5? IIS6?

    * What is an assembly binding redirect? Where are the places an administrator or developer can affect how assembly binding policy is applied?

    * Compare and contrast LoadLibrary(), CoCreateInstance(), CreateObject() and Assembly.Load().

评分

参与人数 1威望 +10 收起 理由
FiveStar + 10 精品文章

查看全部评分

回复  

使用道具 举报

4#
发表于 30-5-2007 23:06:23 | 只看该作者
这么好的文章要狂顶。收藏了谢谢。
等找到.NET工作了请楼主吃饭
回复  

使用道具 举报

5#
 楼主| 发表于 30-5-2007 23:46:55 | 只看该作者
呵呵,这么好啊!有分加还有饭吃?
回复  

使用道具 举报

6#
发表于 23-1-2008 11:31:15 | 只看该作者
收藏,谢谢楼主
回复  

使用道具 举报

7#
发表于 23-1-2008 16:31:44 | 只看该作者
学习一下,感谢楼主
回复  

使用道具 举报

您需要登录后才可以回帖 登录 | FreeOZ用户注册

本版积分规则

小黑屋|手机版|Archiver|FreeOZ论坛

GMT+11, 29-11-2026 16:02 , Processed in 0.018997 second(s), 24 queries , Gzip On, Redis On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表