Sunday, 29 April 2007

Eternal Interview Questions

Having spent most of my life as an IT contractor, I have been through a lot of technical interviews. There are several questions that I am asked in pretty much every single interview I have been to that I am sure will be asked again.

The interviewers must be noticing how perfect interviewees answers are getting to these repeated queries. My hint is to stop asking them. They are boring and beyond simple. I like interviews that make me think of the best way to solve a problem. You can not list the perfect interview questions because they are not ones that you can learn and recite. Good interview questions make you use your brain, your experience and your skill to demonstrate you can. Asking questions that a first year would know is pretty insulting.

As for the interviewee, don't be verbose and try to impress them with your answers. Just answer the question and wait for the next. Always remember that if they ask you stupid questions, it could be because they do not know the answers to the hard ones.

.NET Questions

What is the difference between an abstract class and an interface?
I'd rather answer why a raven is like a writing desk at the Mad Hatter's tea party. It is the eternal question, across languages, dimensions and time. There are a couple of things they could want you to say at this point - an abstract class can be partially implemented but not instantiated; an interface has no implementation and outlines the public methods and constants that a class is contracted to implement when inheriting from it. I have found that they sometimes want you to say that you can inherit from multiple interfaces and one base class. Whatever! Really, this question has to go!

What are the different types of uses for the keyword 'using'?
They want you to know that there is a using directive and a using statement. They want you to know about the using statement so that you properly handle objects whose classes inherit from IDisposable, to ensure their Dispose method is called. The example I give every time is the way to handle an ADOConnection within a using block. It gets smiles and claps and happiness throughout the room. Unfortunately, I feel empty for having to answer that same question for the thousandth time.

What is the difference between a Server.Transfer and a Response.Redirect?
This is meant to show that you understand the difference between the browser sending you to a page and the server sending you to a page. Client-Server and the difference between where decisions are made. They love it when you tell them the back button doesn't know where to go if you Server.Transfer. That gets the mexican wave going.

Does .NET have multiple inheritance?
They want the perfect succinct answer at this point - .NET allows multiple inheritance of interfaces but only one base class.

SQL Questions

What is the difference between a primary key and an index?
Again, a question that is asked over and over again and is just not that hard to guess even if you only know Access. One is the physical order and the other is a logical order of the data.

Dumb First Year Uni Questions

I flat out refuse to answer these but here they are...

What is polymorphism?
What is inheritance?

Things you can look up if you care to

We live in a time of storage devices - iPods for my music so I don't sing out loud on the bus; TB drives to store all the photos my friends, family and I have take over the years so that I can print them at any time; and Google for all those difeekult words to spell. If something can be looked up or derived from first principles then there is no reason to remember it. OK, that is going a little far but it is in the right direction. Why would you ask the following questions, especially when it is something a developer would go look up in a book or on the 'blag when they need it?

HTTP error codes?
All the methods on a StringBuilder?
Syntax error meanings?
The difference between a datetime and smalldatetime?


DISCLAIMER: I am very glad that I am so happy with my current job, so that I will not be out there having to answer these questions for a while.

4 comments:

Anonymous said...

Yeah, really looking forward to face some more of these "pearls of wisdom", in the near future.

Anonymous said...

The quote syntax ones bug me ..
My answer ...
Use intellisense, thats why it was created. Us developer now have to cover such a large surface area.

Damana Madden said...

Yeah, there are a number of things that disturb me about questions like that...

- you usually avoid them with intellisense; and
- when you hit one, it is usually a typo or copy paste error.

I have been asked about syntax errors in 3 interviews in the last 18 months. I get a little nervous about whether I'm missing some big .NET movement to "syntax awareness" :o) but I'm pretty convinced it's just inane and moronic questioning.

David Keaveny said...

Someone blogged a while back that the original Java class library was small enough that you could learn all the objects and methods; but think about the .NET Framework, you're talking about 10s of 1000s of classes. Anyone expecting you to know the syntax for a technical test is right out of their tree; as Steve says, that's what Intellisense is for. Only masochists program .NET/Java in Notepad (real masochists do it in Vi...)