RSS Feed for ASP.NET Interview QuestionsCategory: ASP.NET Interview Questions

How would one do a deep copy in .NET? »

System.Array.CopyTo() - Deep copies an Array

In the context of a comparison, what is object identity versus object equivalence? »


Contrast the use of an abstract base class against an interface? »

In the interface all methods must be abstract, in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes

Does JITting occur per-assembly or per-method? How does this affect the working set? »


What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not? »

Debug build contain debug symbols and can be debugged while release build doesn’t contain debug symbols, doesn’t have [Contional(”DEBUG”)] methods calls compiled, can’t be debugged (easily, that is), less checking, etc. There should be a speed difference, because of disabling debug methods, reducing code size etc but that is not a [...]

What is the difference between Debug.Write and Trace.Write? When should each be used? »

The Debug.Write call won’t be compiled when the DEBUG symbol is not defined (when doing a release build). Trace.Write calls will be compiled. Debug.Write is for information you want only in debug builds, Trace.Write is for when you want it in release build as well. And in any case, you should use [...]

Why is catch(Exception) almost always a bad idea? »

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.

How does the XmlSerializer work? What ACL permissions does a process using it require? »

XmlSerializer requires write permission to the system’s TEMP directory.