Tuesday, November 29, 2011

How to interview well for a programmer position - Part 1

Our team is currently trying to add new programmers. We've been on the lookout primarily for seasoned programmers with good .NET skills, but we've recently broadened our search to entry level candidates simply because there seems to be more demand than qualified candidates these days. This is good news for those folks looking for work or looking to move up, but it makes interviewing candidates a potentially disheartening affair simply because candidates come unprepared.

If you are indeed serious about being a hire-able programmer, there are some things we look for, and these should be true no matter where you end up working. The first and most important quality we are looking for is that you are passionate about programming. What are you doing on a weekly basis to improve your skills? What new languages or technologies are you learning and exploring? What blogs do you read? What podcasts do you listen to? How many tech books have you read through this month? Are you involved in any programmer groups, local meetings, or code camps? Do you have a side projects you're working on? Are you ready to show off some sample code? Work on any code katas lately? If I ask you these questions and you come up with next to nothing, I am going to be tempted to ask you to leave the interview early. Anything I ask you after this may reveal your ability to do work, but it doesn't mean you're the kind of person who enjoys programming and actually wants to show up to work every day. If you're not doing any of these things, please start or find another line of work!

When it comes to the interview itself, be prepared to actually write some code! That seems fairly obvious, but I swear 90% of the candidates have a look of panic when I hand them an Expo marker and then ask them to sketch out a simple method. Remarkably, most candidates struggle with such a simple exercise which entails nothing more than what should already be second nature to you if you're a bona fide programmer. On one job interview I went on, the hiring manager sat me in front of a computer and asked me to program a simple web page for a blog comment entry system. He dictated the specs as I wrote it and was so impressed that I could actually do it that he was ready to hire me on the spot. Too often, I see people struggle with the simplest algorithm. Be ready to code "on your feet", and that just means more practice on your desired platform until Google is a last resort, not your first instinct. I highly recommend coding katas  as a practice tool.

Look, I'll even give you a freebie. I typically start with a simple problem such as "given a string that contains your first name, write a method that returns a string with the spelling reversed". Sounds easy, right? It is, but if you take all 30 minutes of our interview time to solve it, you won't be working with me. Something that trivial should take you 2 or 3 minutes, and you should probably be able to solve it in at least 2 different ways. (If you're a .NET programmer, you could use LINQ to do it in 2 lines.)

The same is true for databases. If your previous jobs involved writing SQL queries and stored procedures, you can better believe that I am going to ask you to write up a few simple queries to prove that you can actually do it without Googling. Be ready to know how to write a simple JOIN, and for gosh sakes know the difference between an inner join and an outer join.

The bottom line is that you need to be ready to prove to the hiring manager that you can do the job without a lot of help. The best way you can do that is practice your programming skills in your target platform so that when people ask for something easy, you don't hesitate and you simply do it.

Monday, November 14, 2011

To length or not to length - that is the question

I needed to find a way to determine if a Silverlight app had been loaded in a div of an iframe. I wasted some time  trying to set a boolean flag and tracking events trying to get it set correctly. jQuery to the rescue! The consensus seems to be that this is the best way to check for the existence of a tag:

if ( $('#targetdiv').length > 0 )

or if you want to be tricky

if ( $('#targetdiv').length )

Of course, my target div was in an iframe so I used this:


if ( $('#ResultsFrame').contents().find('#silverlightControlHost').length > 0 )