C# Interview Questions & Answers

Showing 10 of 62 questions | Page 6

Technical interview questions and answers help you perform well in any C# Interview because companies test your understanding of .NET concepts, OOPs, collections, delegates, LINQ, and error handling. C# is widely used in enterprise applications, making it a key skill for software development roles. Companies like TCS, Wipro, Infosys, Cognizant, and Capgemini frequently ask core C# questions to evaluate your coding skills and understanding of the .NET ecosystem. This guide includes commonly asked C# interview questions with detailed explanations to help freshers and job seekers strengthen their technical foundation. These questions will support your preparation for coding rounds, technical interviews, and project-related discussions.

C# developers can expand their Microsoft technology stack by learning .NET framework  architecture and Windows programming  techniques 

Showing 10 of 62 questions

51. What

Value, and its datatype depends on whatever variable we

52. What

It returns a read-only dataset from the data source when the command is executed.

53. What

System.Object.

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

When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class, but not all base abstract methods have been over-ridden.

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

Classes in the same namespace.

56. Where is the output of TextWriterTraceListener redirected?

To the Console or a text file depending on the parameter passed to the constructor.

57. Which one is trusted and which one is untrusted?

Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.

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

The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities.

59. Why can

They all must be public. Therefore, to prevent you from getting the false impression that you have any freedom of choice, you are not allowed to specify any accessibility, it

60. Why is it a bad idea to throw your own exceptions?

Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.
Questions and Answers for Competitive Exams Various Entrance Test