C# Interview Questions & Answers, Part 2
11. How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.
12. What’s the .NET collection class that allows an element to be accessed using a unique key?
HashTable.
13. What class is underneath the SortedList class?
A sorted HashTable.
14. Will the finally block get executed if an exception has not occurred?
Yes.
15. What’s the C# syntax to catch any possible exception?
A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.
16. Can multiple catch blocks be executed for a single try statement?
No. Once the proper catch block processed, control is transferred to the finally block (if there are any).
17. Explain the three services model commonly know as a three-tier application.
Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).
10 .NET questions
How do you view the methods and members of a DLL? - What is shadowing?
- How do you load an assembly at runtime?
- If I am writing in a language like VB or C++, what are the procedures to be followed to support .NET?
- Compare Client server application with n-Tier application
- Differences between DLL and EXE?
- Can an assembly have EXE?
- Can a try block have more than one catch block?
- Can a DLL be changed to an EXE?
- Compare & contrast rich client (smart clients or Windows-based) & browser-based Web application
- What are the collections you’ve used?
- Can a try block have nested try blocks?