- What’s wrong with a line like this? DateTime.Parse(myString);
- Doesn'tspecify a locale or format.
- What are PDBs? Where must they be located for debugging to work?
- Program Database files. They contain references that connect the uncompiled code to the compiled code for debugging. They must be located either in the same place as the EXE/DLL, or in your VS.NET specified symbols path.
- Whatis cyclomatic complexity and why is it important?
- It's a measure of the number of independent linearly executed paths through a program. It's important for judging the complexity of software and assisting in determinations of which modules should be refactored into smaller components.
- Write a standard lock() plus “double check” to create a critical section around a variable access.
- bool notLocked = true;
if (notLocked) {
lock (typeof(lockingObject)){
if(notLocked) {
notLocked= false;
foo= lockingObject;
notLocked= true;
}
}
}
- bool notLocked = true;
- What is FullTrust? Do GAC’ed assemblies have FullTrust?
- FullTrust means all .NET security permissions are granted to the assembly. GAC assemblies have FullTrust by default, but that can be changed by the user's security policy.
- What benefit does your code receive if you decorate it with attributesdemanding specific Security permissions?
- Allows administratorsto see exactly which permissions your application needs to run; prevents your code from being exploited beyond what permissions it absolutely needs; allows your application to forcibly fail instead of havingto manually handle situations where it might be denied permissions it requires.
- What does this do? gacutil /l | find /i "Corillian"
- Lists all assemblies in the GAC, searching for those whose names contain "Corillian".
- What does this do? sn -t foo.dll
- Shows the token for foo.dll.
- What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
- 135 for the service control manager, 1024-65535 (or whatever range the administrator has restricted DCOM to) for applications.
- Contrast OOP and SOA. What are tenets of each?
- OOP tries to encapsulate functionality required to operate on data with the data structure itself, making objects "self-reliant". SOAaims to decouple functionality from data entirely, using interfaces to allow functional components to operate blindly with as little understanding of the precise nature of the data they're fedas possible, allowing many types of data sets to be fed into them for the same operation.
- How does the XmlSerializer work? What ACL permissions does a process using it require?
- Reflects the object and reads its interfaces to serialize them. Requires the .NET ReflectionPermission, obviously.
- Why is catch(Exception) almost always a bad idea?
- Because itswallows an exception without doing anything with it. The only timethis should really be used is when trying risky casts that you expect to have a reasonable likelihood of failure, but always of a very specific type.
- What is the difference between Debug.Write and Trace.Write? When should each be used?
- Debug.Write isn't compiled in if the project isn't built with the DEBUG symbol. Trace.Write calls are compiled regardless.
- What is the difference between a Debug and Release build? Is therea significant speed difference? Why or why not?
- Release buildsdon't contain debug symbols and are more compact and optimized.
- Does JIT-ing occur per-assembly or per-method? How does this affect the working set?
- Per-method. This affects the working set because methods that aren't lined up for calls aren't loaded, reducing its footprint.
- Contrast the use of an abstract base class against an interface?
- Abstract classes can provide implementations for methods and properties. Interfaces only provide required declarations.
- What is the difference between a.Equals(b) and a == b?
- The first uses the object's equivalency constructor to see if it considers itself value-equal to the the second object. The second construct compares their memory references to determine if they are the SAME object.
- In the context of a comparison, what is object identity versus object equivalence?
- Identity means that two references point to the same memory address. Equivalence means that two objects share the same value.
- How would one do a deep copy in .NET?
- Implement the IClonable interface, and define your implementation to execute deep copies on your sub objects (possibly through IClonable interfaces). Alternatively, serialize the objectand then deserialize it into another object, but this is very slow compared to a dedicated cloning interface.
- Explain current thinking around IClonable.
- IClonable is preferable to using copy constructors because it is standardized and utilized by other portions of the.NET framework to generate object copies.
- What is boxing?
- Taking a value type and converting it to an object reference. Unboxing is the reverse process.
- Is string a value type or a reference type?
- It's an "illusionary value type" that masks an interface to the System.Stringreference type.
- What is the significance of the "PropertySpecified" pattern used by the XmlSerializer? What problem does it attempt to solve?
- Defines the specific parameters that .NET class members serialize into. Solves the issue of an XML spec needing to have slightly different names for class members than the class itself does.
- Why are out parameters a bad idea in .NET? Are they?
- Output parameters create uncertainty about the data which may be returned from the function, and permit the caller to potentially pass bad references which your function must validate before using. From a design standpoint, it's more elegant to define a custom class with multiple properties in the event that youneed to return multiple values from a single function.
- Can attributes be placed on specific parameters to a method? Why is this useful?
- Yes. This might be needed to specify remoting implementations or types for method parameters, or to provide metadata for method parameters when exporting a code library.
Wednesday, October 12, 2005
Questions for Senior Developers/Architects
Subscribe to:
Post Comments (Atom)
Nice Job, but i guess, you should write detailed replies.
ReplyDeleteThank you!!