Code 401 Class 36 Reading Notes
Whiteboard Advice
Communicate
Best piece of technical interview advice is to communicate.
What is “communicate?”
- Do not start solving the problem.
- Do restate the question, seek affirmation
- “So I’d like to restate the problem to you to make sure I understand what you’re looking for… “
- Ask about edge cases.
- “Is it possible that the input would be a type other than a number?”
- “If so, what should the function do?”
- “Can the input be 0 or negative?”
- “Again, if so, what should the function do?”
- Write the pseudocode and ask if it makes sense.
- Super bonus: If your pseudocode looks good but you end up having difficulty translating it to actual code, you have actually earned a lot of points by now! Sure, in some elite companies they won’t accept anything but functional code, but simply being able to reason through the pseudocode is sufficient for many great companies.
- Write the actual code and ask if it looks good
- Stuck? Ask for Help
- “I’m a bit stuck here, do you have any tips to nudge me in the right direction?”
- Ask before hand if there is a coding portion of the interview.
- Even ask if there is anything in particular you should prepare. (languages, number of questions, style of questions)
7 Tips
1. Take a few Minutes
- Wait till the interviewer is done explaining the problem. Ask any clarifying questions.
- “Okay, got it. If it’s okay with you, I’m just going to take a minute or two here and think about the problem, and then I’ll start talking.”
- Think on it, and decide on a approach. Then re-engage the interviewer and let him know what you’ve concluded.
- “So, I think that, since the array is sorted, it makes the most sense to do something like a binary search here. Here are the general steps that I think are involved in the solution: …”
2. Write down the steps of the solution
- Write down the steps (the algorithm?) of how you will solve it on one side of the white board.
- Start at middle of array.
- Keep variables tracking left and right boundaries of search area.
- If value equal to search_val, return true.
- If left and right boundaries are adjacent, return false.
- If value bigger than search_val, go halfway towards left boundary, and move the right boundary along with us.
- If value smaller than search_val, go halfway towards right boundary, and move the left boundary along with us.
3. Write pseudocode first
4. Don’t sweat the small stuff
These aren’t about how well you have remembered your semicolons. They are about demonstrating depth and breadth of knowledge, personality strengths, and problem-solving abilities. Bruch off the mistakes you made and move along.
If you can’t remember something without looking it up, say that.
“…and here, I’d use whatever the list.contains() equivalent is in JavaScript. I know it’s not contains, but I can’t remember the method name right now, so we’ll call it contains() for now and I’d look it up right now if I were coding this.”
5. Sit down. Be humble
- Are you able to express your ideas and solutions clearly and effectively?
- Do you treat the interviewer with respect?
- How do you accept criticism (technical, constructive or otherwise)?
- Are you able to collaborate with others to come up with solutions?
- Do you communicate in a way that demonstrates empathy?
- Are you honest (especially about yourself)?
By providing help and feedback in the interview, they are offering you a chance to show you you can think and work some more.
6. Come prepared
You’ve gotten the interview, your doing the white board, you have done all you can do up until that point to be a better programmer. Now is your time to shine.
7. Review your work
- If you have time, look at the algorithmic effieciency. Have you found the fastest and most optimal solution given the requirements?
- Have you checked for edge cases? Off by one errors? Issues with negative numbers or empty arrays or missing keys or string with weird patters of characters?
Things I want to know more about
How to input DS in brain directly.