I find that Pair Programming something that many developers still have little experience of, so when it comes to a “Pair Programming” session in an interview they are either unnecessarily nervous, or naively confident. Now don’t get me wrong, a little naive confidence can often be a good thing, but sometimes it does pay to be prepared.
Here some advice that I’ve collected over the years which seems to go down well – keen to hear anyone else’s thoughts in the comments! But in my experience if you follow these tips, you’ll have every reason to be confident an interview:
WHAT IS PAIR PROGRAMMING?
Whether have years of experience with pair programming OR you have never programmed before, its important to know that Pair Programming is basically just “social programming”. Something you do every day but sitting next to a fellow coder who is watching your screen and inputing ideas, and with a technical discussion involved.
AND A PAIR PROGRAMMING INTERVIEW?
Normally there is a “Pilot” who is doing the actual coding and the “Co-Pilot” who is sitting next to the Pilot and working with them on the logic and “two heads is better than one”. Typically in a Pair Programming interview you’ll be the Pilot and you’ll be given one or more exercises and asked to complete them.
As a general rule, it is a VERY good idea to follow Test Driven Development and to write your solution to the given exercises using Unit tests. This is not always “critical critical” but over the years I have discovered that this is a classic pitfall that many people forget to start with in the “heat of the moment”. Why is TDD important, basically because its another tenant of Agile and XP and if a company wants you to do a Pair Programming session as part of an interview, its a fair guess that they also follow the Agile methodology.
Be OO and follow Best Practice
Remember this is a technical round. So obviously make sure your programming is as best as it can be. So within the confines of the task at hand keep to best practice, follow OO programming principles and set out to impress without over-engineering a solution!
Try to Relax
This is what you do every day. The guy sitting next to you wants you to succeed (really they do, its awkward sitting next to someone who is having their own internalised car crash, so they’ll be keen to support you to get the best out of you as a candidate), so try to relax and be yourself.
I’m sure you can agree that two people sitting in silence in front of a computer could be a bit weird. So, take the initiative and be friendly from the start. Chit chat with them as you walk over to the computer – think about inane stuff you can talk about that will help you two start to feel comfortable with each other. Stuff like football, the latest Java conference, the weather, cr@p that will break the ice before you sit down.
The other part to making sure this paired programming session goes well is to keep talking. So try to describe your thought processes as you go, and explain what you are doing as you do it.
If you need time to code
A great little tip is that if you feel you need some time to get your head down and focus on some code is to ask the person sitting next to you something that will naturally need a long winded answer. Something like “Tell me about life at ABC Ltd” or “So what’s your background then?”, that way they’ll start talking and you can focus!
Don’t Be Afraid of Silences
BUT don’t be afraid of silences when they come. Some silences will be natural so don’t let that worry you.