Things to keep in mind for white board interviews


  • 10

    Hi @administrators @contributors @Global-Moderators

    After giving a few onsites,
    I've realized that writing code on white board is completely different from typing it on an editor. Firstly because, I type way faster than I write and secondly I can't keep adding lines in between, so the first line has to be my best line of code, and lastly there's not enough space!

    What are some of the things I should keep in mind before I write my code, so that I make sure I make minimal changes once I write?

    Any tips/tricks or suggestions are welcome! I will consolidate the responses, and update here.

    Few things I have learned.

    1. It's very VERY important to write code on a paper. You can get better only if you practice hard on this.
    2. When you're coding online, every time you hit backspace, it's gonna hurt in your real interview. This means you'll have to erase and rewrite. Forget reordering of the code, that'll mess up the whole white board.
    3. When practicing on leetcode or anywhere else, try to make sure that the first time you type is your best line of code.
    4. Use short variables, smaller text, and make sure you have complete picture before you start writing the code. Leave extra space to declare additional variables in case needed later.

    For me it took about 50-60% additional time to write simple binary search on paper compared to coding the same on editor.


  • 1

    Thank you for your precious tips.
    Yeah, I agree with you very much. Writing directly on paper can see more from a candidate.

    Some times I write code on the web editor, I may forgot the methods of some data structures. For example, when I use array, I am not sure whether it is append or push_back or insert since different language have different api for a same data structure. So you should keep in mind all the useful api of them. (the usage of append in array also varies in python and golang).


  • 0

    I agree with both of you. I don't know how much writng on a white board resembles writing on a paper. Personally don't have white board. Maybe the scale is different. Ofcourse assistants will have no problem with this, they write on a blackboard to the students most of the time. Someone advised to split the white board into two parts, one for the code, the other for thinking and drawing. If the whiteboard is not big enough, I think that is impossible to split it into parts


  • 1

    @andyreadsall Yes, definitely practice writing code on a piece of paper, or even better, buy a whiteboard and practice on it! You want to simulate the real coding environment as closely as possible.

    During onsite interviews, try to start writing code as high up as possible so you leave plenty of space below. Leave some vertical spaces between lines so you can easily insert new lines of code if you have to.

    Before writing code, it is helpful to break down the problem into several small pieces, ideally each small piece should be a separate function itself. It is helpful if the function itself is trivial to implement but contain some small details which can detract from the main algorithm itself. You can always implement these functions later.

    Make sure you have thought of all edge cases and have a clear picture of the entire algorithm before you begin coding. Otherwise you will spend lots of time fixing the mistakes due to missing a specific case / not planning ahead carefully.


  • 1

    I think we should vote this post up:beers:


  • 0

    Thanks everyone! Agree with you all.. Having picture of entire algorithm is very important!


  • 0
    G

    @andyreadsall @1337c0d3r
    Thank you for the great advice! I just bought one from Axxxon.
    Shame for the terrible handwriting... first time though.
    0_1465088655417_Screen Shot 2016-06-04 at 6.03.49 PM.png


  • 4

    @GoGoDong Looks great! I would avoid using the variable L as it looks like a 1 and I can't tell which is which.

    Steve Yegge has a popular blog post and gives some great tips about whiteboard coding too. He even go as far as bringing your own whiteboard marker to the onsite interviews.


  • 1
    G

    @1337c0d3r
    Thanks! Just read that through.
    True, I also bought a set of low-odd "slim-head" makers, which is greater than the wide ones!


  • 1

    Whiteboard seems very good. I practice with A3 white paper list. And the problems are when I miss something.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.