Basics of Whiteboarding

What is whiteboarding?

Anney Park
4 min readOct 1, 2020

Back when I used to work in recruiting, our team would review the candidate’s resume and undergo a brief screening but it was mostly during the technical interview where our software engineers decided whether to place the candidate on their team or not. That technical interview consisted of reviewing the candidate’s projects and previous work but also a whiteboarding session that would last a minimum of 1 hour. It involves algorithmic heavy problem solving and no internet or access to any resources. Algorithm problems require no knowledge of a specific tech stack and allow companies to hone in on a person’s problem solving skills.

What they’re looking for is how you think and explain your thought process and not so much the code itself.

As a disclaimer, I am not comfortable with whiteboarding by all means. I’m writing this article to encourage my own self and force myself to get familiar with this topic. No junior is an expert right off the bat or none that I heard of so if you’re on the same boat as me then welcome. It’s intimidating and discouraging when you see the level 7KYU problem on Codewars and not knowing where to even start. The only way to get better? PRACTICE PRACTICE PRACTICE!!!! Make an account on www.codewars.com/ and keep on practicing. Practice until you feel like the new Jeff Dean of Google AI which will be one hell of a challenge so keep practicing until you do. I personally recommend buying a whiteboard and practice like how you would in real life. Work on at least one problem a day to keep those muscles going.

Whiteboard Interview

Before you begin your whiteboarding problem, make sure all the questions you have are clarified before you begin. Once that’s answered, verbally and physically make a list of all the steps you need to take before coding out a solution. Let’s take a look at one problem I got from codewars and tackle it step by step as if we were in an official interview.

In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number.Example:high_and_low("1 2 3 5")  # return "5 1"
high_and_low("1 2 -3 4 5") # return "5 -3"
high_and_low("1 9 -5") # return "9 -5"

Here are some questions I might ask the interviewer before I begin:

  • Can I assume that there will never be duplicate numbers?
  • Will there always be at least one number in the input string?
  • Is the output string separated by a single space? comma?
  • Is the output always going to have the highest number first?

Asking these questions show that I understand the complexity of the problem and that I can communicate when I need clarification.

Here are my notes I will explain verbally & also write down after:

  • the number are in a string so I need to un-string it (split?)
  • I need to go thru all the numbers… (map?)
  • find the minimum (min?)
  • find the maximum (max?)
  • maybe use minmax which returns an array containing the min and max
  • need to have highest first so reverse
  • but then I need to string it back at the end (join?)

Below is the solution but that’s not really what they’re looking for. What they’re looking for is HOW you got to that answer, step by step. Even if the final solution may not work perfectly because you didn’t test the function, if you can explain your logic correctly, it shows that you can understand the complexity of the problem.

def high_and_low(numbers)
numbers.split.map(&:to_i).minmax.reverse.join(' ')
end

This interview will also be an evaluation on how well you work under pressure. Do you start making up stuff up and BS your way through? Or do you calmly ask questions to clarify your objective? If you don’t understand how to solve the problem right off the bat, are you open to communication? Realistically, if you don’t know how to solve the problem at all but ask good questions then chances are that maybe you won’t get the job but it may make a good impression on the people interviewing you which may stick with them in a later interview.

Again, keep practicing. The more you are familiar with algorithmic problems the easier it’ll be to refine your problem solving skills. It’s not something you just wake up with. Learn to work well under pressure, know how to take a deep breath, verbalize your plan, list it out, and take it step by step.

I wish you the best. Make an account on www.codewars.com/ if you haven’t done so already! :)

--

--