1. Home
  2. Docs
  3. Interview Technical Quest...
  4. C# Technical Interview Qu...
  5. Section 7: Exception Handling (81–85)

Section 7: Exception Handling (81–85)

81. How do you handle exceptions in C#?
Use try-catch-finally blocks to catch and manage exceptions.

82. Difference between throw and throw ex?

  • throw: preserves stack trace
  • throw ex: resets stack trace

83. What are checked vs unchecked exceptions in C#?
C# only has unchecked exceptions; all exceptions are runtime-checked.

84. What is custom exception?
A user-defined class inheriting from Exception for specific error scenarios.

85. Best practices for exception handling?

  • Catch only specific exceptions
  • Avoid empty catch blocks
  • Log exceptions
  • Rethrow when necessary

How can we help?