I came across these "interview questions" on the web for anyone who'd like to become a .NET developer.
I found a bit depressing that I wasn't able to answer most of these questions, often not even recognizing the terms used. I don't think I'll learn about many of these concepts in university, and it has me wondering on how will I ever get that knowledge. What do you think about that list, can you answer most of the questions ?
Anyway, here's how I fared without resorting to Google or any external reference :
What Great .NET Developers Ought To Know
Describe the difference between a Thread and a Process?
Threads share global variables, they take less time to create and communication between them is easier.
What is a Windows Service and how does its lifecycle differ from a "standard" EXE?
A service runs in background while a “standard” exe has some kind of GUI ?
What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
Uh, 128MB ? Yeah, not the same as system virtual memory which is quite large… and no idea what the last question is about.
What is the difference between an EXE and a DLL?
DLL = code library, can be used by programs. EXE = a program.
What is strong-typing versus weak-typing? Which is preferred? Why?
Strong typing means each object has a definite type, weak-typing means the type can change at run-time depending on use. Strong-typing is generally preferred because it allows the compiler to do more validating.
Corillian's product is a "Component Container." Name at least 3 component containers that ship now with the Windows Server Family.
Uh, what ?
What is a PID? How is it useful when troubleshooting a system?
Process Identification number ? If so, used to identify a process, but I couldn’t give an example.
How many processes can listen on a single TCP/IP port?
I’ve no idea.
What is the GAC? What problem does it solve?
Garbage Collector ? If so, solves the problem of memory management.
Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming.
I’ve no idea what is interface- and aspect-oriented programming.
Describe what an Interface is and how it’s different from a Class.
An interface holds no data members (at least in C#), it only contains public method declarations. A class can implement multiple interfaces; each is a contract specifying a few methods the class has to support. C# supports only single inheritance for classes.
What is Reflection?
Ability for a program to look at its own types and methods through metadata, but I couldn’t give an example.
What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?
What did you just say ?
Are the type system represented by XmlSchema and the CLS isomorphic?
XmlSchema ? CLS ? isomorphic ? aaargh
Conceptually, what is the difference between early-binding and late-binding?
Early-binding consists in that the compiler knows all the types, late-binding means they will be resolved at run-time (really not sure).
Is using Assembly.Load a static reference or dynamic reference?
What ?
When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate?
You decide !
What is an Asssembly Qualified Name? Is it a filename? How is it different?
It’s an attribute of an assembly, a filename is not. (phew)
Is this valid? Assembly.Load("foo.dll");
How should I know.
How is a strongly-named assembly different from one that isn’t strongly-named?
Uh…
Can DateTimes be null?
NO BECAUSE THEY’RE VALUE TYPES! Woohoo answered one question correctly !
What is the JIT? What is NGEN? What are limitations and benefits of each?
JIT is just-in-time compilation, it means that code is compiled just before it is ran, and it can be optimized specifically for the platform. NGEN means all the code is compiled once, so it prevents that kind of optimization. I don’t know why someone would use NGEN though it’s likely because of my ignorance. Hire me please I need the money.
How does the generational garbage collector in the .NET CLR manage object lifetime? What is non-deterministic finalization?
Basically when an object is not referenced from the application, it becomes a candidate for garbage collection. Generational garbage collection means that candidates are split according to how long they have lived in terms of number of gc passes. An object that has survived many garbage collections is less likely to be collected than one that has not survived one.
Non-deterministic finalization means that you never know when objects will be “finalized”, that is, destroyed by the GC.
What is the difference between Finalize() and Dispose()?
Dispose is a method the user calls, Finalize is a method the GC calls. Both are used to do some special treatment before the object is released.
How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?
The using() pattern makes it so that the object being “used” will automatically be “disposed” (with its method Dispose(), presented by interface IDisposable) by C#. So it’s useful when you need to make sure that after a certain code block, a resource is freed, such as TCP port or a printer or whatever finite resource. This is a form of deterministic finalization.
What does this useful command line do? tasklist /m "mscor*"
That’s a nice question.
What is the difference between in-proc and out-of-proc?
Hey, that one too.
What technology enables out-of-proc communication in .NET?
Ok ok, I get it.
When you’re running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?
A very nice process for sure.
What’s wrong with a line like this? DateTime.Parse(myString);
Parse returns a DateTime, so it should be assigned to some variable otherwise the line is useless. I’m not sure that’s what you were expecting though.
What are PDBs? Where must they be located for debugging to work?
Files that contain debug symbols, they should be located in the debug folder.
What is cyclomatic complexity and why is it important?
It’s how many paths there are through a method, and it’s important when you need to test the said method.
Write a standard lock() plus “double check” to create a critical section around a variable access.
The only example I know is an implementation of Singleton :
if (instance_ == null) {
lock();
if (instance_ == null) {
instance_ = new Singleton();
}
unlock();
}
What is FullTrust? Do GAC’ed assemblies have FullTrust?
Uh…
What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?
Weee !
What does this do? gacutil /l | find /i "Corillian"
Weee !
What does this do? sn -t foo.dll
Weee !
What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
Weee !
Contrast OOP and SOA. What are tenets of each?
OOP = global variables/methods are EVIL. Use objects for representing everything and storing every method.
SOA = it’s like soap, but without the p.
How does the XmlSerializer work? What ACL permissions does a process using it require?
Weee !
Why is catch(Exception) almost always a bad idea?
That’s swallowing the exception, right ? Well, exceptions are supposed to tell you about something that shouldn’t have happened, so if the code swallows them they lose their purpose.
What is the difference between Debug.Write and Trace.Write? When should each be used?
Weee !
What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
Debug means there are all the debug symbols and no optimizations, release is optimizations and no debug symbols, and yes release can be much faster because of said optimizations, but you can’t easily debug it of course.
Does JITting occur per-assembly or per-method? How does this affect the working set?
I guess it’s per-method, but what’s a working set ?
Contrast the use of an abstract base class against an interface?
An interface is just a contract to support certain public methods. An abstract base class can contain data and implementations and private methods. A type could implement multiple interfaces, but it can only have one base class.
What is the difference between a.Equals(b) and a == b?
a.Equals(b) returns an integer, a==b returns a bool.
In the context of a comparison, what is object identity versus object equivalence?
Identity = same object, physically (both references point to the same object). Equivalence = a.Equals(b) returns 0, what it means depends on the implementation of Equals.
How would one do a deep copy in .NET?
I should read that Base Class Library book one more time.
Explain current thinking around IClonable.
Weee !
What is boxing?
It means putting a value type inside an object, making it collectable by the GC. It happens automatically when, say, you add an int to an ArrayList.
Is string a value type or a reference type?
Reference type.
What is the significance of the "PropertySpecified" pattern used by the XmlSerializer? What problem does it attempt to solve?
Um.
Why are out parameters a bad idea in .NET? Are they?
I don’t see why they would be a bad idea, as long as they’re used carefully.
Can attributes be placed on specific parameters to a method? Why is this useful?
Attributes ? Care to explain ?
Juxtapose the use of override with new. What is shadowing?
Can you repeat the question ?
Explain the use of virtual, sealed, override, and abstract.
Virtual is placed in front of methods that can be overridden in derived classes.
Sealed is placed in front of classes that must not be specialized.
Override is the counterpart of virtual, you put this in front of the virtual method you are overriding in the derived class. Otherwise you’re hiding the virtual method = no polymorphism.
Abstract means the class can’t be instantiated.
Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d
Weee !
Explain the differences between public, protected, private and internal.
For a method or field : public means accessible outside of the class, protected means accessible only inside of this or derived classes, private means accessible only inside this class. For a type : public means everyone can see the type, internal is default and means only types inside the assembly can see the type, private is for nested types, it means only the “mother” type can see it. Phew.
What benefit do you get from using a Primary Interop Assembly (PIA)?
Primary what ?
By what mechanism does NUnit know what methods to test?
NUnit, that’s for unit testing right ?
What is the difference between: catch(Exception e){throw e;} and catch(Exception e){throw;}
catch(Exception e){throw e;} rethrows the same exception, the other one throws a standard Exception I think ?
What is the difference between typeof(foo) and myFoo.GetType()?
There is none ?
Explain what’s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?
Whoa, that compiles?
What is this? Can this be used within a static method?
this is what the object uses to refer to itself. And no, because this refers to an instance and static methods pertain to the class rather than instances of the class.
Question
Andre S. Veteran
I came across these "interview questions" on the web for anyone who'd like to become a .NET developer.
I found a bit depressing that I wasn't able to answer most of these questions, often not even recognizing the terms used. I don't think I'll learn about many of these concepts in university, and it has me wondering on how will I ever get that knowledge. What do you think about that list, can you answer most of the questions ?
Anyway, here's how I fared without resorting to Google or any external reference :
Link to comment
Share on other sites
22 answers to this question
Recommended Posts