1、C# Interview QuestionsIT公司面试手册提供最全的软件测试类面试题 .net面试题: C# 面试题:ASP.NET面试题:更多面试题请访问: C# Interview QuestionsBase questions.1. Explain the differences between Server-side and Client- side code? ANS: Server side code will execute at server end all the business logic will execute at server end where as clie
2、nt side code will execute at client side at browser end. 2. What type of code (server or client) is found in a Code-Behind class? ANS : Server side. 3. Should validation (did the user enter a real date) occur server-side or client-side? Why? ANS : client side . there is no need to go to validate use
3、r input. If it relates to data base validation we need to validate at server side. 4. What does the EnableViewState property do? Why would I want it on or off? ANS: IT keeps the data of the control during post backs. if we turn off the values should not populate during server round trip. 5. What is
4、the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other? ANS: Server.Trnasfer will prevent round trip. it will redirect pages which or in the same directory. NO way to pass the query strings . Thru http context we can able to get the previous page control
5、values. Response.Redirect : There is a round trip to process the request. We can redirect to any page external / internal other than aspx. We can pass the query string thru which we can manage sessions. 6. Can you give an example of when it would be appropriate to use a web service as opposed to a n
6、on-serviced .NET component ANS : Web services are best suite for Hetrogenious environment. Remoting is best suite for Homogenious environment. The systems that under CLR. 7. Lets say I have an existing application written using Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows
7、 2000 COM+ transaction services. How would you approach migrating this application to .NET We need to have Wrapper to communicate COM components in .net. and vis versa CCW : Com Callable wrapper. RCW : RUN time callable wrapper. 8. Can you explain the difference between an ADO.NET Dataset and anADO
8、Recordset? ANS : DIsconnected architechure . Maintainace relation schemas. MUtilple table grouping. Connected one . 9. Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines? ANS: APplication_start need for global variable which are avail
9、able over the application. Sesssion_Start : login dependent ( user dependent) 10. If Im developing an application that must accomodate multiple security levels though secure login and my ASP.NET web appplication is spanned across three web-servers (using round-robbin load balancing) what would be th
10、e best approach to maintain login-in state for the users? ANS : Database Support. or Thru state service. 11. What are ASP.NET Web Forms? How is this technology different than what is available though ASP (1.0-3.0)? ANS : ASP . Interprepter. use the script engine. ASP.Net Compiled. 12. How does VB.NE
11、T/C# achieve polymorphism? ANS : Function overloading. Operator overloading. 13. Can you explain what inheritance is and an example of when you might use it? ANS : Heredity. Use the existing functionality along with its own properities. 14. How would you implement inheritance using VB.NET/C#? ANS: D
12、erived Class : Basecalss VB.NEt : Derived Class Inherits Baseclass 15. Whats an assembly ANS : A Basic unit of executable code Which contains : Manifest - Meta data versioning , Calture , IL, Reference 16. Describe the difference between inline and code behind - which is best in a loosely coupled so
13、lution Tightly coupled - INLINE ANS: inline function bind at compile time can write in aspx page with in . 17. Explain what a diffgram is, and a good use for one ANS : is an xml grammer. It talks about state of node in xml file. 18. Where would you use an iHTTPModule, and what are the limitations of
14、 any approach you might take in implementing one ANS: Preprocessing before going to IIS. 19. What are the disadvantages of viewstate/what are the benefits ANS : IT can be hacked . page size is heavy. 20. How would you get ASP.NET running in Apache web servers - why would you even do this? ANS: - Ins
15、tall Mod_AspDotNet Add at the end of C:Program FilesApache GroupApache2confhttpd.conf the following lines 21. Whats MSIL, and why should my developers need an appreciation of it if at all? ANS : Microsoft Intermediate language. which is the out put for all the .net supported languages after compilat
16、ion will produce. Appreciation for cross language support. 22. In what order do the events of an ASPX page execute. As a developer is it important to understand these events? ANS : INIT, PageLoad, Prerender , UNload. 23. Which method do you invoke on the DataAdapter control to load your generated da
17、taset with data? Fill() 24. Can you edit data in the Repeater control? NO 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 Repeatercontrol? AlternateItemTemplate27. What property must you set, a
18、nd what method must you call in your code, in order to bind the data from some data source to the Repeatercontrol? Datasource, DataBind28. What base class do all Web Forms inherit from? System.Web.UI.Page29. What method do you use to explicitly kill a user s session? abondon()30. How do you turn off
19、 cookies for one page in your site? disablecookies. 31. Which two properties are on every validation control? control to validate, error message 32. What tags do you need to add within the asp:datagrid tags to bind columns manually? autogenerated columns is set to false 33. How do you create a perma
20、nent cookie? Cooke = new cookie(). cooke.adddate. 34. What tag do you use to add a hyperlink column to the DataGrid? hyper link column 35. Which method do you use to redirect the user to another page without performing a round trip to the client? Server. Transfer 36. What is the transport protocol y
21、ou use to call a Web service SOAP http 37. True or False: A Web service can only be written in .NET false 38. What does WSDL stand for? webservice discription language. it is used to generate for proxy( server object) 39. What property do you have to set to tell the grid which page to go to when usi
22、ng the Pager object? Page Index.40. Where on the Internet would you look for Web services? UDDI 41. What tags do you need to add within the asp:datagrid tags to bind columns manually. Autogenerate columns 42. Which property on a Combo Box do you set with a column name, prior to setting the DataSourc
23、e, to display data in the combo box? datatext datavalue43. How is a property designated as read-only? get 44. Which control would you use if you needed to make sure the values in two different controls matched? compare filed validator 45. True or False: To test a Web service you must create a window
24、s application or Web application to consume this service? no 46. How many classes can a single .NET DLL contain? as many as u want. 47. What is serialization, how it works in .NET? The primary purpose of XML serialization in the .NET Framework is to enable the conversion of XML documents and streams
25、 to common language runtime objects and vice versa. Serialization of XML to common language runtime objects enables one to convert XML documents into a form where they are easier to process using conventional programming languages. On the other hand, serialization of objects to XML facilitates persi
26、sting or transporting the state of such objects in an open, standards compliant and platform agnostic manner.48. How many array types does C# provide?Jugged array, table array, General Questions1. Does C# support multiple-inheritance? No. 2. Who is a protected class-level variable available to? It i
27、s available to any sub-class (a class inheriting this class).3. Are private class-level variables inherited? Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited. 4. Describe the accessibility modifier “protected internal”. It is a
28、vailable to classes that are within the same assembly and derived from the specifiedbase class. 5. Whats the top .NET class that everything is derived from? System.Object. 6. What does the term immutable mean?The data value may not be changed. Note: The variable value may be changed, but the origina
29、l immutable data value was discarded and a new data value was created in memory. 7. Whats the difference between System.String and System.Text.StringBuilder classes?System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations
30、 can be performed. 8. Whats the advantage of using System.Text.StringBuilder over System.String?StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed,a new instance in memory is created. 9. Can you store
31、 multiple data types in System.Array?No. 10. Whats the difference between the System.Array.CopyTo() and System.Array.Clone()?The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array eleme
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1