These days I got an interview with N company, I was asked about the pair programming questions:

Q: Please talk about pair programming and what you think is an advantage and a disadvantage. (Also talking about your most recent experience)


Based on wiki the definition of pair programming is one, the driver, writes code while the other, the observer or navigator,reviews each line of code as it is typed in. The two programmers switch roles frequently.

Based on my knowledge/experience, the advantages are:
1. two programmers can share knowledge (To me it is a way to improve myself)
2. when my colleague is driving, I can think from the outside square, and reduce risk of bug.
3. I think as a human being, we cannot focus on one thing all the times, the switching of roles can improve the time management.
4. The pair programming practice makes programmer “honest” ^_^ they are not likely to spend time in surfing the net, checking personal email etc.

The disadvantages are:
1. I think everyone is different. If there is a conflict between those two programmers, it is not easy to collaborate the ideas. But on the other side, it is really a good way to listen to different voice. When this happens to us, we will discuss it from biz logic to performance to code quality. I think from this kind of communication it is easy to “persuade” the other side. I do not wanna be a winner in the discussion, I just want to do things better.
2. The understanding of the biz logic is different from each other.Thus it may cause conflict as well.
3. I think from employer’s perspective, the company needs to hire pairs instead of an individual programmer.