1. Big-O analysis
    Prepare space and time complexity of the problems.
  2. Input validation
    Validate all your input, which is true for both production code and interviews. However, many people assume inputs are all validated without even asking. Ask interviewers for clarification, which can save you from unnecessary checkings. For instance, you may ask if you can assume all inputs are integers. If the answer is yes, then you can skip the integer checking in your code.
  3. Check corner cases
    Consider corner inputs when writing your solution. Secondly, after you finish your code, use few example inputs to test your solution and you can include several corner inputs.
  4. Clean code
    First, you should have good handwriting on a whiteboard. Many people tend to write very fast in hopes of saving time, however they may waste more time to explain what they have written. Second, you should care about your coding style. I suggest everyone pay attention to this point as it’s both a low hanging fruit for interview preparation and a great habit for your work.
  5. Prepare questions at the end of the interview
  6. Be confident in communication
    A lot of people are so nervous in an interview that they are even afraid of making a single mistake. As a result, they tend to be very unconfident in communication. For example, even if they are quite sure about the time complexity, they could still say “I guess the time complexity might be O(n), I may be wrong though”. From the interviewer’s perspective, it seems that the candidate is not very clear about big-O analysis although he gave the correct answer. Also keep discussing with the interviewer so that you may still figure out the correct answer later.