How to get unstuck during a pair-programming interview

One of the hardest parts of pair programming is figuring out what to do when you get stuck. Especially when you’re pair programming as part of a job interview. What do you say? How do you prove you’re a reliable, competent coder, when you feel…kinda lost?

We asked for advice from two experienced developers. Avielle Wolfe and Zach Gershman both use pair programming in their workplaces, day-to-day, and for interviews. They shared their experiences and tips.

We also assembled some specific examples of phrasing to use when you’re stuck. Read on to learn three problem-solving communication strategies that make a great impression.

What can you do when you’re stuck in front of an interviewer?

Advice from Avielle Wolfe, thoughtbot

“Do what you would normally do when you get stuck coding,” Avielle says. Feel free to look up the documentation, google for answers, or look at source code for clues. Do what’s familiar. “The difference is that you’re talking it all out with the person,” Avielle adds.

Usually an interviewer will supply some contextual knowledge for you. You don’t need to instantly master the whole codebase. Avielle says she usually selects interview tasks based on a candidate’s level of experience. She also tries to choose something with clear boundaries.

Learning during the interview is one hundred percent okay. This is definitely not a trivia quiz.

A candidate “might be coming into a language or a framework that they don’t know,” Avielle explains. That’s happened to her!

At one interview, “I had never seen Ember before and I hadn’t done much JavaScript work either,” Avielle says. “I had to talk a lot to with the person who was interviewing me. They got to see how I learned, and that’s what I’m going to have to do all the time in the job. It’s more important than coming in with all the answers.” Phew!

Advice from Zach Gershman, Pivotal Labs

“First and foremost, don’t panic!” Zach says. “Even the best programmers get stuck. Interviews are always stressful,” he adds.

Interviews tend to feel like a test. Remind yourself that your interviewer can help!

“To unstick yourself, use your pair as a resource! Ask as many questions as you like,” Zach says. “Your pair in the interview is there to work with you, not just evaluate you, so pretend like they are your co-worker already and use their institutional knowledge.”

Explaining your process out loud is also recommended. Though it may feel awkward, Zach sees value in saying you are stuck. Expose your gaps in knowledge. Explain how you are trying to break down the problem. That’s encouraged!

“Normally we want to see how someone works through a problem, not just that they got to the right answer,” Zach explains.

But what do you say when you’re stuck? 

Asking good questions can get you unstuck. It’s also important to highlight your competence as a problem-solver. Here are some strategies:

Example 1: Make connections
😑 “Oh no. I’m stuck. I don’t know how to x.”
😎 “Hmm. I know a and b usually work together. I think b would solve the problem I’m seeing here. But the program is asking for c. Is c like b? What does c do differently?”

Example 2: Highlight what you do know
You could even drop in references to completed projects you’re proud of. For example:
😑 “Uh oh. I’m stuck and I don’t know how to x.”
😎 “Hm. I know a and b usually work together. I used b in an app to do _____, and the result was ____. Is this the result we need here?”

Example 3: Look around the codebase
😑 “Crap, I have no idea what to do next.”
😎 “I’m looking at nearby code for clues. I think this part does ____ task to produce ____ result. Is that correct? Can you tell me how this fits with the rest of the program? How does it impact _____ that we need to receive/create?”

LEARN MORE
Interested in learning how to present your skills in a job interview? Check out Season 2, Episode 3 of the CodeNewbie podcast.

If you would like to try pair programming, here’s advice on how you can find a pairing buddy and get practice.

Leave a Comment