How To Win At A Collaborative Coding Interview

Ben NgScreen Shot 2016-11-04 at 2.31.11 PM is a software engineer at Etsy. He previously worked at Shift, enjoys studying distributed systems and mentors at Hackbright Academy. Follow him on Twitter at @_benng

If you’re interviewing for a software engineering position nowadays, one of the first steps in the interview process will be a phone screen. You and the interviewer will look at the same source code using a collaborative code editor like Coderpad. As an engineer for five years and a Hackbright mentor, I’ve been on both sides of the phone. Here’s my big-picture strategy for tackling these interviews, and some advice from experience.

Problem solving is messy. Embrace it!

“Are you going to charge in empty-handed, or carry a sword and a spool of string?”A good interview question will have a solution that isn’t immediately obvious — one that you aren’t expected to know or recognize immediately. Instead, you discover the solution by identifying and solving smaller subproblems, evaluating multiple approaches, and backtracking from failed attempts. Sometimes you’ll need to make a logical leap, and other times you’ll need to make incremental improvements.

Think of the interview as a labyrinth. There’s an unavoidable component of chance involved, but you can maximize your odds of success by having a strategy beforehand. Are you going to  charge in empty-handed and hope for the best, or are you going to carry a sword and a spool of string?

 Five Steps to Success

1. Work some examples manually

Don’t immediately start writing code. There are two good reasons:

  • You want to make sure your understanding of the problem matches the interviewer’s. Try to think of edge-case examples. For example, do you and the interviewer agree on what number the Fibonacci sequence starts with?
  • If you can’t do something manually, you can’t automate it.

The coding questions that you’ll get in phone screens are usually some form of “given this input, produce this output.” Work out a simple example. Then work out some harder ones. Think about edge cases in the input. What if the numbers were negative? What if the integers were real numbers?

2. Translate your examples into test cases

Print this out for your collaborative-coding phone session

A flow chart for problem-solving. Print it and follow it during your collaborative-coding phone session.

After you’ve worked through a few examples, you’ll develop an intuition for what inputs make the problem easy to solve, and what inputs make it difficult. The solutions for the harder cases tend to build on those for the easier ones, so you’ll arrive at a complete solution more quickly if you start by solving the simple cases. Get familiar with your language’s assert library so that you can quickly translate your worked examples into test cases.

3. Start working on a solution

Run your code against your test cases frequently. Get them to pass, one by one. This has two benefits:

  • You’ll demonstrate progress as each test case passes. The interviewer gets to see you methodically tackle a problem rather than flail around. Plus it’s good for your morale.
  • Should you cause an old test case to break — a regression — you’ll know immediately. That’s when the problem is easiest to fix.

4. Look for ways it won’t work

Once all your test cases pass, think of any other edge cases you may have missed. You have a better understanding now of the problem and the solution, so you may come up with situations where your code won’t work. If you do, go back to step 3. Your interviewer will be impressed with how careful you are, and how readily you admit to discovering flaws in your code.

5. Refine it

“Your interviewer will be impressed with how readily you admit to flaws in your code.”Once you’re confident that your solution is behaving correctly, it’s time to refine it; it’s rare to arrive at the optimal solution for a non-trivial problem on the first try. Analyze your solution’s time complexity, and see if you can do better. Common strategies for improvement are pre-sorting the input, using a special data structure, or using dynamic programming. Use your improved understanding of the problem to simplify your code — an elegant recursive solution might be obvious only in hindsight.

If you get a practical problem — like discovering the primary color of an image — you should talk to the interviewer about how you would operationalize your solution. In other words, what do you need to do before you can ship this code? Common topics are security, performance, scalability, testing, and documentation. For example, will your code work on extremely large input? What if a user uploads a Word document when you expected a jpeg image?

Challenges unique to phone interviews

The interviewer can’t see you

This makes it hard for them to gauge your progress. To combat this, you need to over-communicate what you’re doing, whether that’s talking or typing. Whenever possible, show your work in the collaborative text editor. But sometimes, you’ll get a problem that’s very graphical, and easier to think about on paper. For example, it’s far easier to draw a tree and work out a recurrence relation on paper. Tell the interviewer that’s what you’re doing, so they don’t think you’re spinning your wheels.

You can’t see the interviewer

No vision means you’ll be extra-sensitive to everything you hear. Don’t over-react to it.

  • If you hear typing, it’s not because they’re chatting with their friends or working on something else. A good interviewer will be constantly taking notes; they want to capture exactly what you say and do, so that they can make an objective decision later.
  • If you hear a sigh, it’s probably not because of you. Your interviewer may have received an email that their lunch order was delayed.
  • If you don’t hear anything, it’s because they’re giving you quiet time to think. Don’t presume silence means they’ve written you off.

Using the environment

everything-you-think-you-know-about-thomas-edison-might-be-wrong (1)

“I have not failed. I’ve just found 10,000 ways that won’t work.” — Thomas Edison

Run your code often

Frequently make sure that your code compiles, and that your solution is behaving as expected. Unlike a whiteboard interview, you can actually execute code. So do it, and do it often. Very often — several times a minute isn’t uncommon. It’s a rookie mistake to write a large amount of code and then try to get it working at the end.

Got all that?

“As an engineer it’s not just whether you solve a problem, it’s how you do it. Collaborative coding interviews are a unique opportunity to showcase your technical skills. Don’t be intimidated by the stranger watching your every keystroke. Instead, practice the five-step strategy so you can methodically tackle difficult problems under pressure. Before your interview, refresh yourself on the challenges unique to phone screens, so you’re mentally prepared for what’s to come. Finally, don’t forget to use the environment to your advantage, by frequently running your code as you’re working on it. You’ll be a winner, because as an engineer it’s not just whether you solve a problem, it’s how you do it. 

Why Mentors Volunteer To Help Change The Ratio In Tech!

Many non-profits accept volunteers to help young girls and/or underrepresented groups get into STEM (Black Girls Code, Girls Make Games, Technovation). Engineers can volunteer at RailsBridge to help women learn Ruby, or Code2040 to help underrepresented engineers.

Hackbright Academy invites engineers to volunteer as a mentor for an engineering fellow (a woman learning software engineering at Hackbright). The time commitment is an hour a week with your mentee for the course of the quarter. New mentors attend orientation before being assigned a mentee.

Hackbright’s engineering fellowships run on a quarter system, so each quarter Hackbright welcomes a fresh class of available volunteer mentors to supplement our students’ educational experience in the classroom and lab. You can sign up to volunteer here and help change the ratio in tech!

Mentors Giving Back At Hackbright Academy

Dan Malmer is currently the CTO of Blendoor, a blind recruiting app that breaks down unconscious bias one swype at a time. He has mentored at Code2040 and Hackbright Academy, and recommends both mentorship experiences.

A serial engineering leader, Dan is excited for the opportunity to support and give back to engineers early in their own careers. He says: “Mentoring people from different backgrounds who are earlier in their careers has made me a better manager. Working with students reminds me what issues I struggled with earlier in my career, and has made me more effective at managing people who are less experienced.”

Daniel Malmer

“I choose to mentor because I believe it’s the right thing to do. The tech industry has been less welcoming to people who don’t look like me, something that I’ve benefited from. It’s my responsibility to help make the industry more fair.” – Dan Malmer, Blendoor CTO

Rit Breisler has been mentoring at Hackbright Academy for years. He started when he was at BrightRoll as an operations engineer. Recently, he joined Earnest as a systems engineer, referred into the role from his Hackbright mentee Sofia Nguy, who became a software engineer at Earnest after completing the Hackbright engineering fellowship! When asked why he continues to volunteer as a mentor, Rit answers: “I mentor because I am uniquely empowered to do so; the only people who can make tech a more diverse and welcoming place to work are the folks who are already here. I find value in this goal (for a ton of reasons) and so I’m willing to freely give a bit of my time to see it realized.”

Rit Breisler

“I find it profoundly rewarding and inspiring to make a positive difference in someone’s life while watching them conquer challenges. It feels amazing to see a Hackbright get that red hoodie and know that I helped her out in some small way.” – Rit Briesler, Earnest Systems Engineer

“The other side of mentoring is that it can actually make you a better person and a better professional. You have to tap in to patience, empathy, and you have to learn how to communicate effectively with someone more junior than you. There’s also this really interesting phenomenon wherein teaching someone about things you know serves to remind you of what you don’t. The value in this is obvious,” said Rit.

What Does Mentorship Look Like?

Hackbright welcomes back a handful of mentors who volunteer and give back freely (read about our encore mentors here) to support their mentees starting their new careers in engineering.

From helping with technical interview practice, to having conversations about technology over coffee or lunch, mentorship looks different from individual to individual. Find out how you can get involved and sign up to volunteer at Hackbright Academy this year – we have quarterly calls for volunteers!


Hackbright organizes events like mixers and celebrations for our mentors and mentees to meet and have fun, and get to know each other! The Hackbright mentor network is a valuable and growing part of the Hackbright community – we need everyone’s support to change the ratio in tech.

You can sign up to volunteer here and get involved. We are grateful to the growing community of Hackbright mentors who invest time and energy in our graduates.

Aabhas Sharma

“I’ve always been told that what separates a senior engineer from a junior one is what mistakes they’ve made. It’s rewarding to impart that knowledge to an excited, energetic and brilliant kickass-engineer-to-be at Hackbright Academy.” – Aabhas Sharma, Postmates Software Engineer

Have you mentored before? What are your tips and tricks?
Let us know in the comments below!

5 Tips For Pair Programming With Junior Developers

Many tech teams hired their first junior developers last year. Many more are now considering it, and debating how to go about it. Looking at the community chatter on this topic, it’s clear that onboarding junior devs into a team of mid- and senior-level folks is not a solved problem.

Hackbright mentor Sarah Mei has paired with dozens of junior developers over the years. She is a Ruby and JavaScript programmer, and currently Chief Consultant at DevMynd.

You may recognize her as a frequent Ruby conference speaker, or perhaps you’ve been to a Railsbridge workshop (a non-profit organization that provides free Ruby coding workshops for women, which Sarah founded in 2009).

She shares 5 tips for pair programming success on DevMynd’s blog

“Many tech teams hired their first junior developers last year. Many more are now considering it, and debating how to go about it. Looking at the community chatter on this topic, it’s clear that onboarding junior devs into a team of mid- and senior-level folks is not a solved problem. Hell, my company is heading into its sixth cohort of apprentices, and the question of how to structure their time still provokes passionate debate internally.

The problem is that it all goes wrong so easily. The typical interaction patterns of a more experienced team are mystifying to someone new to all this, and it’s easy for a junior developer to feel unprepared, overwhelmed, and disconnected. Under those circumstances, they can hardly do good work, and your investment in their growth is unlikely to pay off.

I see a lot of teams combat this with pair programming…”

➠ Read Sarah’s full blog post on DevMynd here – “Pairing With Junior Developers”

* * *

Sarah has written a number of blog posts on topics like “Programming Is Not Math” and “Why You Should Never Use MongoDB”. She has also taught Ruby to high school girls and speaks at conferences.