C# Interview Answers

2 min
9
0
0
Published on updated on
  1. Can multiple catch blocks be executed? No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.
  2. What is the .NET datatype that allows the retrieval of data by a unique key? HashTable.
  3. What is the advantage of using System.Text.StringBuilder over System.String? StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created.
  4. What is a delegate? A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.
  5. What is a multicast delegate? It’s a delegate that points to and eventually fires off several methods.
  6. How do you generate documentation from the C# file commented properly with a command-line compiler? Compile it with a /doc switch.
  7. What does assert() do? In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.
  8. What is the difference between the Debug class and Trace class? Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.
  9. Explain ACID rule of thumb for transactions. The transaction must be:

Atomic (it is one unit of work and does not depend on previous and following transactions), Consistent (the data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t),

Isolated (no transaction sees the intermediate results of the current transaction),

Durable (the values persist if the data had been committed even if the system crashes right after).

  1. 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.
  2. Why would you use untrusted verification? Web Services might use it, as well as non-Windows applications.
  3. What does the parameter Initial Catalog define inside Connection String? It defines the database name to connect to.
  4. What is the data provider name to connect to Access database? Microsoft.Access.
  5. What does the Dispose method do with the connection object? It deletes the connection object from the memory.
  6. What is a pre-requisite for connection pooling? Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.

Find C# jobs

Continue reading around the topics :

Comment

In the same category

The best IT jobs for introverts IT Career Advice
Introverts can thrive in IT jobs that require focus, problem-solving, and independent work. There are plenty of roles perfect for those who prefer working behind the scenes.
4 min
data jobs in the UK IT Career Advice
Data jobs in the UK are in high demand, with roles in data science, engineering, and analysis offering excellent career stability. From junior data analysts to senior roles like chief data officer, these positions provide clear growth opportunities with salaries ranging from £25,000 to £100,000+
3 min
Preparing for your Junior Data Analyst interview IT Career Advice
Interviews for a Junior Data Analyst role can be challenging, but preparation is key. Be ready to discuss tools like Excel, SQL, and Python, and share how you've used them in projects. This guide covers key questions and tips to help you feel confident.
4 min

Connecting Tech-Talent

Free-Work, THE platform for all IT professionals.

Free-workers
Resources
About
Recruiters area
2024 © Free-Work / AGSI SAS
Follow us