arachnode.net
An Open Source C# web crawler with Lucene.NET search using SQL Server 2008/2012/2014/2016/CE An Open Source C# web crawler with Lucene.NET search using MongoDB/RavenDB/Hadoop

Completely Open Source @ GitHub

Does arachnode.net scale? | Download the latest release
What great .NET developers ought to know...

What Great .NET Developers Ought To Know

Everyone who writes code

  • Describe the difference between a Thread and a Process?

A single process can have multiple threads, which are work units and can easily share memory space.

  • What is a Windows Service and how does its lifecycle differ from a "standard" EXE?

A Windows service is meant to stay running, and can be started and stopped, and runs in the background.  This is not a case where you might need O2 broadband packages or other software.  A service must also conform to the rules of the SCM (Service Control Manager...)...  The main difference is that a service does not need a user to be logger on to use it.

  • 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?

For a 32-bit system it is 4GB - 2GB for the application space, and 2GB for the kernel space, which is shared by all applications.

  • What is the difference between an EXE and a DLL?

Entry point.  .exe's contain a user interface.  A .dll is meant to be consumed by an application, or .exe, or another .dll.

  • What is strong-typing versus weak-typing? Which is preferred? Why?

Strong typing defines rules and restrictions on how variables of a type may be operated upon.  Weak typing does not impose these restrictions.  For example, integer division may not be performed on strings in a strongly-typed language.

  • Corillian's product is a "Component Container." Name at least 3 component containers that ship now with the Windows Server Family.

  • What is a PID? How is it useful when troubleshooting a system?

A PID is a "Process Identifier" and us used to uniqely identify a process, or kill the offending process.  Smile

  • How many processes can listen on a single TCP/IP port?

One.

  • What is the GAC? What problem does it solve?

The "Global Assembly Cache" - is a set of references to .dlls/libraries/assemblies... The GAC solves .dll hell, by specifying a type, but also a version, SN for that type.

Mid-Level .NET Developer

  • Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming.

 

  • Describe what an Interface is and how it’s different from a Class.

An interface is an abstract class where all methods are public and abstract.  A class defines an implementation of functionality.

  • What is Reflection?

The ability to inspect/operate on types at runtime.

  • What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?

 

  • Are the type system represented by XmlSchema and the CLS isomorphic?

 No, they are not the same.

  • Conceptually, what is the difference between early-binding and late-binding?

In early-binding, the call information is known at compile time.  In late-binding, the call information is known at runtime.

  • Is using Assembly.Load a static reference or dynamic reference?

Dynamic.  Assembly.Load(...) is an example of late-binding, or a dynamic reference.

  • When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate?

When loading code from a file, such as a plugin.  (Like arachnode.net uses...)

  • What is an Asssembly Qualified Name? Is it a filename? How is it different?

The Assembly Qualified Name contains the assembly name, version and public key token and allows versioning and signing as opposed to a simple filename.

  • Is this valid? Assembly.Load("foo.dll");

No.  "foo.dll" is not a valid assembly name.

  • How is a strongly-named assembly different from one that isn’t strongly-named?

 It can be placed in the GAC, for one.  If you know the public key, you can verify that it hasn't been tampered with.

  • Can DateTimes be null?

No.  DateTime is a structure and not a class.

  • What is the JIT? What is NGEN? What are limitations and benefits of each?
  • How does the generational garbage collector in the .NET CLR manage object lifetime? What is non-deterministic finalization?
  • What is the difference between Finalize() and Dispose()?

Finalize() is called by the CLR, and Dispose() is called by the user.  Finalize() is a destructor, called by the GC when your object goes out of scope.

  • How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?

The using pattern is helpful for instructing the GC when it is immediately OK to call Finalize(), or the scope of when an object may be disposed.  IDisposable is an interface that defines a contact (a bit redundant to say, I know) for memory reclamation on objects.  When the using statement ends, Dispose() is called on the object.

  • What does this useful command line do? tasklist /m "mscor*"

It shows all processes that loaded a .dll with the name matching the given pattern.  We would see all of the applications/processes that has loaded/were using the .NET framework.

  • What is the difference between in-proc and out-of-proc?

Out-of-proc requires marshaling between two processes.

  • What technology enables out-of-proc communication in .NET?

.NET Remoting.

  • When you’re running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?

The ASP.NET worker process.

Senior Developers/Architects

  • What’s wrong with a line like this? DateTime.Parse(myString);

It doesn't do anything, really.  And, you should specify a parse format.

  • What are PDBs? Where must they be located for debugging to work?

Debug information for the .exe or .dll.  Next to the assembly.

  • What is cyclomatic complexity and why is it important?

It is a maintainability index used to describe class coupling and the number of paths through code.  It is an important measurement of how maintainable code is and how difficult it will be to test that code.

  • Write a standard lock() plus “double check” to create a critical section around a variable access.

if(true condition)
{
lock(_lock)
{
if(true condition)
{
}
}
}

  • What is FullTrust? Do GAC’ed assemblies have FullTrust?

Full Trust means the assembly has unrestricted permission to system resources.  Yes, GAC'd assemblies have full trust.

  • What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?
  • What does this do? gacutil /l | find /i "Corillian"

Finds all assemblies in the GAC that have "Corillian" in their identity.

  • What does this do? sn -t foo.dll

Displays the public key token for assembly foo.dll.

  • What ports must be open for DCOM over a firewall? What is the purpose of Port 135?

135 is used by Windows RPC.  HKEY_LOCAL_MACHINE\Software\Microsoft\Rpc\Internet (Key) Ports specifies what other ports will be open.

  • Contrast OOP and SOA. What are tenets of each?

OOP differs from SOA in that SOA removes the intimacy between entities.  OOP - Abstraction, Encapsulation, Inheritance, Polymorphism.  SOA - Policy based negotiation, Explicitness of boundaries, Autonomy, Contract Exchange Diferences, or (PEACE)...

  • How does the XmlSerializer work? What ACL permissions does a process using it require?
  • Why is catch(Exception) almost always a bad idea?

You should only catch the exceptions your code intends to, or is equipped to handle.  Also, your code probably shouldn't catch StackOverflow and OutOfMemory exceptions.

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

Debug.Write only outputs trace information in debug builds.  Trace.Write will output in debug and release builds.  Tracing also has 5 levels of verbosity.

  • What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
  • Does JITting occur per-assembly or per-method? How does this affect the working set?
  • Contrast the use of an abstract base class against an interface?

This is one of my favorites, and I'll pilfer the answer from MSDN:

1.) If you anticipate creating multiple versions of your component, create an abstract class.  Abstract classes provide a simple and easy way to version your components.  By updating the base class, all inheriting classes are automatically updated with the change.  Interfaces, on the other hand, cannot be changed once created.  If a new version of an interface is required, you must create a new interface.
2.) If the functionality you are creating will be useful across a wide range of disparate objects, use an interface.  Abstract classes should be used primarily for objects that are closely related, whereas interfaces are best suited for providing functionality to unrelated classes.
3.) If you are designing small, concise bits of functionality, use interfaces.  If you are designing large functional units, use an abstract class.
4.) If you want to provide common, implemented functionality among all implementations of your components, use and abstract class.  Abstract classes allow you to partically implement your class, whereas interfaces contain no implementation for any members.

Interface Abstract Base Class
A class may implement several interfaces A class may inherit from only one abstract class
An interface cannot provide any code at all, must less default code An abstract class can provide complete code, default code, and/or just stubs that must be overridden.
Interfaces are often used to describe peripheral abilities of a class, not its central identity.  Example: An automobile class may implement IRecyclable, which doesn't strictly apply to the auto class.  Interfaces define a 'can do' relationship. An abstract class defines the core identity of its descendants.  If you defined an Dog abstract class, and then a Rottweiler class that extended the Dog abstract class, the Rottweiler class is not merely a Dog.  Abstract classes define an 'is' relationship.
If all the various implementaions share is the method signatures, then an interface works best. If the various implementations are all of a kind and share a common status and behaviour, usually an abstract class works best. Another issue that's important is what I call "heterogeneous vs. homogeneous." If implementors/subclasses are homogeneous, tend towards an abstract base class. If they are heterogeneous, use an interface. (Now all I have to do is come up with a good definition of hetero/homo-geneous in this context.) If the various objects are all of-a-kind, and share a common state and behavior, then tend towards a common base class. If all they share is a set of method signatures, then tend towards an interface.
If you add a new method to an interface, you must track down all implementations of that interface in the universe and provide them with a concrete implementation of that method. If you add a new method to an abstract class, you have the option of providing a default implementation of it. Then all existing code will continue to work without change.

  • What is the difference between a.Equals(b) and a == b?

Depends on the type.  Comparing integers versus strings would have two different meanings/results.

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

An identiy comparision checks for true object equivalence... do object a and object b point to address A.  Object equivalence would mean the values of two objects match, but are not pointed to the same actual address.

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

Either through serialization, if all members of the type support serialization, or by member to member copy, preferrably implementing IClonable.

  • Explain current thinking around IClonable.
  • What is boxing?

Is the mechanish by which a value type is converted to a reference type.

  • Is string a value type or a reference type?

A reference type.

  • What is the significance of the "PropertySpecified" pattern used by the XmlSerializer? What problem does it attempt to solve?
  • Why are out parameters a bad idea in .NET? Are they?

Not necessarily a bad idea, but often the same result can be achieved through design simplification.  Dictionary.TryGetValue(...) is a good example of a valid usage of an out parameter.  Also, out parameters may not be assigned in the case of an exception... better to use 'ref'.

  • Can attributes be placed on specific parameters to a method? Why is this useful?

Yes.  Marking a parameter as, say, "NotNull" can instruct the user, or inform them view compiler warnings of the intended usage of a method.

C# Component Developers

  • Juxtapose the use of override with new. What is shadowing?

Override provides additional functionality to a member of a method in a derived class, while new hides the bass class implementation.  Shadowing means the method is hidden in the base class.

  • Explain the use of virtual, sealed, override, and abstract.

 

 

Virtual allows downcasting from the base class to the derived class, or, that a class extending a base class may override that method which is marked 'virtual'.  sealed means the method may not be overridden, when specified on a method, and when on a class means that the class may not be inherited/extended.  override means that the method changes the base class functionality.  abstract can be applied to a method or class, meaning either that it can not be instantiated, when referencing a class, or that the method must be defined by the class the implements the base class containing the abstract method signature.

 

 

  • Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d

  • Explain the differences between public, protected, private and internal.

public = accessible inside and outside of the class and assembly.  protected = accessible from classes that extend the class containing the protected modifier.  private = accessible only within the class.  internal = accessible only within the class and assembly.

  • What benefit do you get from using a Primary Interop Assembly (PIA)?
  • By what mechanism does NUnit know what methods to test?

Method attributes.

  • What is the difference between: catch(Exception e){throw e;} and catch(Exception e){throw;}

throw e adds to the stack trace, which could be significantly different than the actual location the exception was caught, and throw preserves the stack trace.

  • What is the difference between typeof(foo) and myFoo.GetType()?

typeof is a compile time structure, determining what CLS type that foo is, and GetType() returns the instance and is a runtime structure.

  • Explain what’s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?

Aside from being somewhat difficult to read on one line... the parametrized constructor calls the non-parametrized constructor and is useful for instantiating/assigning variables that are used in the class.

  • What is this? Can this be used within a static method?

this is a reference to the current object.  this cannot be used on static methods because they don't have an object.

ASP.NET (UI) Developers

  • Describe how a browser-based Form POST becomes a Server-Side event like Button1_OnClick.
  • What is a PostBack?
  • What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState?
  • What is the <machinekey> element and what two ASP.NET technologies is it used for?
  • What three Session State providers are available in ASP.NET 1.1? What are the pros and cons of each?
  • What is Web Gardening? How would using it affect a design?
  • Given one ASP.NET application, how many application objects does it have on a single proc box? A dual? A dual with Web Gardening enabled? How would this affect a design?
  • Are threads reused in ASP.NET between reqeusts? Does every HttpRequest get its own thread? Should you use Thread Local storage with ASP.NET?
  • Is the [ThreadStatic] attribute useful in ASP.NET? Are there side effects? Good or bad?
  • Give an example of how using an HttpHandler could simplify an existing design that serves Check Images from an .aspx page.
  • What kinds of events can an HttpModule subscribe to? What influence can they have on an implementation? What can be done without recompiling the ASP.NET Application?
  • Describe ways to present an arbitrary endpoint (URL) and route requests to that endpoint to ASP.NET.
  • Explain how cookies work. Give an example of Cookie abuse.
  • Explain the importance of HttpRequest.ValidateInput()?
  • What kind of data is passed via HTTP Headers?
  • Juxtapose the HTTP verbs GET and POST. What is HEAD?
  • Name and describe at least a half dozen HTTP Status Codes and what they express to the requesting client.
  • How does if-not-modified-since work? How can it be programmatically implemented with ASP.NET?
    Explain <@OutputCache%> and the usage of VaryByParam, VaryByHeader.
  • How does VaryByCustom work?
  • How would one implement ASP.NET HTML output caching, caching outgoing versions of pages generated via all values of q= except where q=5 (as in http://localhost/page.aspx?q=5)?

Developers using XML

  • What is the purpose of XML Namespaces?
  • When is the DOM appropriate for use? When is it not? Are there size limitations?
  • What is the WS-I Basic Profile and why is it important?
  • Write a small XML document that uses a default namespace and a qualified (prefixed) namespace. Include elements from both namespace.
  • What is the one fundamental difference between Elements and Attributes?
  • What is the difference between Well-Formed XML and Valid XML?
  • How would you validate XML using .NET?
  • Why is this almost always a bad idea? When is it a good idea? myXmlDocument.SelectNodes("//mynode");
  • Describe the difference between pull-style parsers (XmlReader) and eventing-readers (Sax)
  • What is the difference between XPathDocument and XmlDocument? Describe situations where one should be used over the other.
  • What is the difference between an XML "Fragment" and an XML "Document."
  • What does it meant to say “the canonical” form of XML?
  • Why is the XML InfoSet specification different from the Xml DOM? What does the InfoSet attempt to solve?
  • Contrast DTDs versus XSDs. What are their similarities and differences? Which is preferred and why?
  • Does System.Xml support DTDs? How?
  • Can any XML Schema be represented as an object graph? Vice versa?

Posted Mon, Sep 21 2009 7:45 PM by arachnode.net

Comments

Kevin wrote re: What great .NET developers ought to know...
on Tue, Sep 22 2009 6:28 AM

Hey this is fun to read through and see what I DO NOT know that I should :)

arachnode.net wrote re: What great .NET developers ought to know...
on Tue, Sep 22 2009 7:44 AM

These items come from Scott Hanselman's blog.  Thought it would be a good idea to answer all of them.  I wanted to get back into working through my programming challenges book and got sidetracked by this.

Milo wrote re: What great .NET developers ought to know...
on Thu, Sep 24 2009 1:35 PM

Wow...I wonder how long it'll take me te learn all that stuff in reality...I mean I knew a few, but some terms were like black magic :D Thanks anyway, now I know what way I need to go through!

An Open Source C# web crawler with Lucene.NET search using SQL 2008/2012/CE

copyright 2004-2017, arachnode.net LLC