Skip to content

Latest commit

 

History

History
126 lines (83 loc) · 7.56 KB

whiteboarding.md

File metadata and controls

126 lines (83 loc) · 7.56 KB

Intro to live code challenge

Projected Time

45-60 minutes

  • 20 minutes for Lesson
  • 15 minutes for Check for Understanding

Prerequisites

Motivation

Whiteboarding and code challenges are used to determine a candidate's ability to problem solve and break down difficult problems into smaller pieces.

It is helpful to practice brainstorming multiple solutions to a problem, talking through your thinking process, and consider complications before beginning to write any code. Whiteboarding is a skill that improves through practice; it has more to do with confidence than knowledge.

Code challenges are great to practice because they can be your golden ticket into any tech company. It gives you the confidence to succeed and it wows the interviewers with your impressive coding ability!

White-boarding is a practice performed in virtually all companies. It is frequently a part of an on-site interview, and is a skill that every developer should learn to help convey clearly their ideas and designs to colleagues and stakeholders. It is so important that Google has a product to support collaborative white-boarding (https://gsuite.google.com/products/jamboard/)

Objectives

Participants will be able to:

  • Understand what interviewers are looking for during a code challenge
  • Ask the right clarifying questions about their challenge
  • Plan their solution before starting to code
  • Describe the parts of the code they are writing, and the reasons for them
  • Test their own functions
  • Find resources for further learning

Specific Things to Learn

  • Whiteboarding: Why and how we do it
  • Overview of Whiteboarding
  1. Think
  2. Plan
  3. Code
  4. Test your code

Materials

Common Mistakes / Misconceptions

  • "I need to write code down as quickly as possible, since I only have X amount of time to solve the problem." Interviewers generally care more about how you approach technical problems, than about how quickly you can write code. Generally, brainstorming and making sure you think through any potential pitfalls at the beginning, will make writing the code much easier and faster.

  • "I must solve the problem completely on my own. My interviewers will think I'm a bad coder if I ask for help." Interviewers have generally seen many people attempt to solve their problem. While directly asking for help may not be good, if you verbalize your current ideas, interviewers will generally guide you in the direction they want you to go.

  • "I know my first idea is a poor solution. I should keep it to myself until I think of a better solution, otherwise the interviewer will think I'm a bad programmer." It's always better to mention your first few ideas for how to solve a problem, even if you think they may not be optimal. Verbalizing why they may not be optimal, shows the interviewer that you do understand time/space complexity and that you can think through edge cases.

  • "I don't think well verbally. I prefer to think inside my head, then share my final result." Interviewers always prefer for you to think out loud, so that they can follow your thought process. Practice thinking out loud, and it will get easier!

Lesson

What interviewers are looking for

  • Can you take requirements and write neat, maintainable code?
  • Can you communicate your thoughts effectively?
  • Do you have an understanding of coding techniques?
  • Can you come up with other approaches and talk about tradeoffs?
  • How do you work under pressure?
  • Can you work well with others? Would they want to work with you?

Think, Plan, Code, Test

  1. Think
  • Before writing or typing, think about your approach. Does this problem feel familiar? What techniques come to mind?
  • Write down the challenge, and ask questions at an in-person whiteboarding to be sure you’re clear about the expectations.
  • Feel free to draw pictures or list things to visualize the process the input would go through in your function. If you comment your thoughts, you can refer to them later.
  1. Plan
  • Jot down a strategy for how you will solve the problem.
  • Then, arrange your plan into a step-by-step process for yourself.
  • This stage will actually help you realize which plans will not work before you’re knee deep in code! Interviewers also like to see how you reason with why some approaches are good and some are not.
  1. Code
  • If your plan seems sound, start coding!
  • If you can think of multiple ways to do it, pick the easiest one to start with. You can improve it later if you have extra time.
  1. Test
  • Prove that it works with a test. Or disprove it ;)
  • On a computer: Type a testing function Have the test function call your function with a new argument, and have it return “ok” or “fail”
  • On a board: talk through a test example. Write an input example, and walk it through the function's process and discuss if the result is what you expected.

Things to Remember

  • Practice on paper, whiteboards, and on your computer
  • Don't rush!! If you focus your energy and time on the planning stage, the rest will fall into place. Feel free to ask for a minute or two to think.
  • Did your test fail? Congratulations, you’re normal. Use console logs to make sure each step is doing what you expect so you can track down the problem. While coding the example in the slides, my test failed and I realized I was just console.logging the function result instead of returning it.
  • Have extra time? Look at your function and ask if you can improve it.
  • Talking while coding feels unnatural, until you’ve done it 20 times. Start practicing now!

Independent Practice

  • Starting next week, you will be doing a practice code challenge every day. Speak out loud or write comments about your thought process as you plan and then write your function.
  • Once a week, find a partner to be your "interviewer" as you solve the code challenge. Their only job is to listen and ask a few questions about your choices and if you can improve your solution. It will feel awkward for a while; the goal is to get used to it before you start real interviews in a few months.

Supplemental Resources

Check for Understanding

  • What is Whiteboard coding?
  • Mention some steps you would follow during a whiteboarding interview.
  • How will you organize your thoughts on the whiteboard
  • Are whiteboarding interviews the best choice?