top of page

OOPs and C#.Net: In this section of the wesbite,we will see the various OOPs concepts and how they are related to the .Net technologies. Implementation with the real time examples, why C# doesnt support multipleinheritance and how the resolve the situations. We will also see the questions related to the Overloading, Overriding, Various types of Inheritance, excelton handling, Abstratc class,Interface etc.

C# Interview Questions

 

1. Does C# support multiple-inheritance?

2. Who is a protected class-level variable available to?

3. Are private class-level variables inherited?

4. Describe the accessibility modifier “protected internal”.

5. What’s the top .NET class that everything is derived from?

6. What does the term immutable mean?

7. What’s the difference between System.String and System.Text.StringBuilder classes?

8. What’s the advantage of using System.Text.StringBuilder over System.String?

9. Can you store multiple data types in System.Array?

10. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?

11. How can you sort the elements of the array in descending order?

12. What’s the .NET collection class that allows an element to be accessed using a unique key?

13. What class is underneath the SortedList class?

14. Will the finally block get executed if an exception has not occurred?­

15. What’s the C# syntax to catch any possible exception?

16. Can multiple catch blocks be executed for a single try statement?

17. Explain the three services model commonly know as a three-tier application.

18. What is the syntax to inherit from a class in C#?

19.Can you prevent your class from being inherited by another class?

20.Can you allow a class to be inherited, but prevent the method from being over-ridden?

21.What’s an abstract class?

22.When do you absolutely have to declare a class as abstract?

22.What is an interface class?

23. Why can’t you specify the accessibility modifier for methods inside the interface?

24. Can you inherit multiple interfaces?

25. What happens if you inherit multiple interfaces and they have conflicting method names?

26. What’s the difference between an interface and abstract class?

27. What is the difference between a Struct and a Class?

28. What’s the implicit name of the parameter that gets passed into the set method/property of a class?

29. What does the keyword “virtual” declare for a method or property?

30. How is method overriding different from method overloading?

31. Can you declare an override method to be static if the original method is not static

32. What are the different ways a method can be overloaded?

33. If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?

34. What’s a delegate?

35. What’s a multicast delegate?

36. Is XML case-sensitive?

37. What’s the difference between the Debug class and Trace class?

38. Why are there five tracing levels in System.Diagnostics.TraceSwitcher?

39. Where is the output of TextWriterTraceListener redirected?

40. How do you debug an ASP.NET Web application?

41. What are three test cases you should go through in unit testing?

42. Can you change the value of a variable while debugging a C# application?

43. What is the role of the DataReader class in ADO.NET connections?

43. What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?

44. What is the wildcard character in SQL?

45. Explain ACID rule of thumb for transactions.

46. What connections does Microsoft SQL Server support?

47. Between Windows Authentication and SQL Server Authentication, which one is trusted and which one is untrusted?

48. What does the Initial Catalog parameter define in the connection string?

49. What does the Dispose method do with the connection object?

50. What is a pre-requisite for connection pooling?

51. How is the DLL Hell problem solved in .NET?

52. What are the ways to deploy an assembly?

53. What is a satellite assembly?

54. What namespaces are necessary to create a localized application?

55. What is the smallest unit of execution in .NET?

56. When should you call the garbage collector in .NET?

57. How do you convert a value-type to a reference-type?

58. What happens in memory when you Box and Unbox a value-type?

59. Explain the differences between Server-side and Client-side code?

60. Can you can specify values for for variables in interfaces in c#?

61. Can you can specify values for for variables in interfaces in c#?

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

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

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

65. What is the difference between Server.Transfer and

Response.Redirect? Why would I choose one over the other?

66. Can you give an example of when it would be appropriate to use a web service as opposed to a non-serviced .NET component

67. Let's say I have an existing application written using Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. How would you approach migrating this application to .NET

68. Can you explain the difference between an ADO.NET Dataset and anADO Recordset?\

69. Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines?

70. If I'm 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 the best approach to maintain login-in state for the users?

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

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

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

73. How would you implement inheritance using VB.NET/C#?

74. Whats an assembly

75. Describe the difference between inline and code behind - which is best in a loosely coupled solution Tightly coupled - INLINE

77. Explain what a diffgram is, and a good use for one

78. Where would you use an iHTTPModule, and what are the limitations of any approach you might take in implementing one

79. Is it namespace class or class namespace?

80. Can you can specify values for for variables in interfaces in c#?

81.What are the disadvantages of viewstate/what are the benefits

82. How would you get ASP.NET running in Apache web servers - why would you even do this?

83. Whats MSIL, and why should my developers need an appreciation of it if at all?

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

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

86. Can you edit data in the Repeater control?

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

88. How can you provide an alternating color scheme in a Repeatercontrol?

89. What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeatercontrol?

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

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

92. How do you turn off cookies for one page in your site?

93. Which two properties are on every validation control?

94. What tags do you need to add within the asp:datagrid tags to bind

columns manually?

95. How do you create a permanent cookie?

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

97. What is the standard you use to wrap up a call to a Web service

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

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

100. True or False: A Web service can only be written in .NET

101. What does WSDL stand for? webservice discription language.

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

103. Where on the Internet would you look for Web services?

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

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

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

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

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

109. How many classes can a single .NET DLL contain?

110. What’s the difference between System.String and System.StringBuilder classes?

111 Describe session handling in a webfarm, how does it work and what are the limits

112. If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor?

113. Use of property in an interface:

114. What’s the implicit name of the parameter that gets passed into the class’ set method?

115. How do you inherit from a class in C#?

116. Does C# support multiple inheritance?

117. When you inherit a protected class-level variable, who is it available to?

118. Are private class-level variables inherited?

119. Describe the accessibility modifier protected internal.

120. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?

121. What’s the top .NET class that everything is derived from?

122. How’s method overriding different from overloading?

123. What does the keyword virtual mean in the method definition?

124. Can you declare the override method static while the original method is non-static?

125. Can you override private virtual methods?

126. Can you prevent your class from being inherited and becoming a base class for some other classes?

127. Can you allow class to be inherited, but prevent the method from being over-ridden?

128. What’s an abstract class?

129. When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?

130. What’s an interface class?

131. Why can’t you specify the accessibility modifier for methods inside the interface?

132. Can you inherit multiple interfaces?

133. And if they have conflicting method names?

134. What’s the difference between an interface and abstract class?

135. How can you overload a method?

VB.Net Interview Questions

 

1. What is versioning in .NET? Explain its importance

2. Where is the version information stored on an assembly?

3. How do we get version information from the AssemblyInfo file?

4. Can you write the namespace to load assemblies at runtime? 

5. Is it possible to allow a class to be inherited but prevent the method from being overridden? If yes, explain it 

6. What happens in memory when you box and unbox a value type? 

7. Differentiate between a panel and GroupBox.

8. Where would you use abstract class and interface? 

9. Show in code to insert a TextBox value into Sql database using VB.NET coding.

10. Differentiate between windows and console application?

11. How does garbage collector work?

12. Explain how to connect crystal report using vb.net

13. What is JIT (Just in time) and how it works?

14. What are the types of threading models in VB.NET? Explain them

15. What is an indexed property? Explain it with a code sample

16. What is the difference between Dataset and Recordset?

17. Difference between a readonly variable and a constant variable

18. How do we read and write data to an XML file?

19. Explain how to get the environment information in VB.NET.

20. Difference between Array and array list

21. How to store and retrieve images in SQL server database through VB.NET?

22. What is the difference between string and stringbuilder?

23. Difference between .dll extension and .exe extension files

24. What are jagged arrays?

25. Difference between Web.Config and Machine.Config

26. Explain how to send xml file on server using HTTP protocol.

27. Explain Anonymous type and its features.

28. How do we write data to a text file in VB.NET?.  

29. What is the difference between VB and VB.Net?

bottom of page