Why you're hitting dead ends in whiteboard interviews
Tags: career, interviewing, interview, beginners
Published: 2018-05-14 18:05:40

---
title: Why you're hitting dead ends in whiteboard interviews
published: true
description: The coding interview is like a maze...
tags: career, interviewing, interview, beginners
canonical_url: https://www.interviewcake.com/why-youre-hitting-dead-ends-in-whiteboard-interviews
---


Listening vs. holding your train of thought
-------------------------------------------

Finally! After a while of shooting in the dark and frantically fiddling with sample inputs on the whiteboard, you've came up with an algorithm for solving the coding question your interviewer gave you.

Whew. Such a relief to have a clear path forward. To not be flailing anymore.

Now you're cruising, getting ready to code up your solution.

When suddenly, your interviewer throws you a curve ball.

"What if we thought of the problem this way?"

You feel a tension we've all felt during the coding interview:

_**"Try to listen to what they're saying...but don't lose your train of thought...ugh, I can't do both!"**_

This is a make-or-break moment in the coding interview. And so many people get it wrong.

Most candidates end up only half understanding what their interviewer is saying. Because they're only half listening. Because they're desperately clinging to their train of thought.

And it's easy to see why. For many of us, completely losing track of what we're doing is one of our _biggest_ coding interview fears. So we devote half of our mental energy to clinging to our train of thought.

To understand why that's so wrong, we need to understand the difference between what _we_ see during the coding interview and what _our interviewer_ sees.

The programming interview maze
------------------------------

Working on a coding interview question is like walking through a giant maze.

You don't know anything about the shape of the maze until you start wandering around it. You might know vaguely where the solution is, but you don't know how to get there.

![A maze with a mouse at one corner labeled "You" and a piece of cheese at the opposite corner labeled "An Answer." Only a small section of the maze directly surrounding the mouse is revealed, showing two possible paths to the cheese.](https://www.interviewcake.com/images/svgs/fog_of_war__maze_start.svg?bust=170)

As you wander through the maze, you might find a promising path (an approach, a way to break down the problem). You might follow that path for a bit.

![The same maze with the mouse further along, nearing the cheese.](https://www.interviewcake.com/images/svgs/fog_of_war__maze_first_path.svg?bust=170)

Suddenly, your interviewer suggests a different path:

![Now the mouse has turned around in the same spot, and an arrow points the mouse back towards the beginning of the maze to a new path.](https://www.interviewcake.com/images/svgs/fog_of_war__maze_new_path.svg?bust=170)

But from what you can see so far of the maze, your approach has already gotten you halfway there! Losing your place on your current path would mean a huge step backwards. Or so it seems.

_That's_ why people hold onto their train of thought instead of listening to their interviewer. Because from what they can see, it looks like they're getting somewhere!

But here's the thing: **your interviewer knows the whole maze**. They've asked this question 100 times.

I'm not exaggerating: if you interview candidates for a year, you can easily end up asking the same question over 100 times.

So if your interviewer is suggesting a certain path, you can bet it leads to an answer.

![Following the new path, the mouse has made it to the cheese at the end of the maze.](https://www.interviewcake.com/images/svgs/fog_of_war__maze_completed.svg?bust=170)

And your seemingly great path? There's probably a dead end just ahead that you haven't seen yet:

![Now the entirety of the maze is revealed, showing that the mouse's original path through the maze lead to a dead end.](https://www.interviewcake.com/images/svgs/fog_of_war__maze_dead_end.svg?bust=170)

Or it could just be a much longer route to a solution than you think it is. That actually happens pretty often—there's an answer there, but it's more complicated than you think.

![Again the maze is revealed, showing an alternate scenario in which the mouse's original path eventually lead to the cheese but in a much more complicated way.](https://www.interviewcake.com/images/svgs/fog_of_war__maze_complicated_path.svg?bust=170)

Hitting a dead end is okay. Failing to listen is not.
-----------------------------------------------------

Your interviewer probably won't _fault_ you for going down the wrong path at first. They've seen really smart engineers do the same thing. They understand it's because you only have a partial view of the maze.

They might have let you go down the wrong path for a bit to see if you could keep your thinking organized without help. But now they want to rush you through the part where you discover the dead end and double back. Not because they don't believe you can manage it yourself. But because they want to make sure you have enough time to finish the question.

But here's something they _will_ fault you for: failing to listen to them. Nobody wants to work with an engineer who doesn't listen.

So when you find yourself in that crucial coding interview moment, when you're torn between holding your train of thought and considering the idea your interviewer is suggesting...remember this:

**Listening to your interviewer is the _most_ important thing.**

Take what they're saying and run with it. Think of the next steps that follow from what they're saying.

Even if it means completely leaving behind the path you were on. Trust the route your interviewer is pointing you down.

Because they can see the whole maze.



----

## Get the free coding interview crash course

Don't leave your interviews to chance. I'll teach you the underlying patterns behind the clever algorithms you'll need to come up with during tricky coding interview questions.

**[Send me coding interview tips &raquo;](https://www.interviewcake.com/free-coding-interview-crash-course?utm_source=dev)**

----