Skip to main content
Version: v1.2

✏️ 4.3.4.3 Whiteboard Practice

Whiteboard Practice


Upcoming Independent Project

The course section following this section will have an independent project that differs from previous independent projects. It will be performed with your peers, and will take the form if a technical interview with peer-evaluations.

This is the final planned practice lesson for whiteboarding to prepare you for this upcoming code review, but you are encouraged to continue practicing your whiteboarding and finding new challenges to take on!

We will review this prompt next week as review during scrum, or a time determined by your instructor.


When and how whiteboarding practice is implemented will be up to your teacher. Below is a recommended prompt.

Goal

As the interviewee:

  • Ask clarifying questions.
  • Keep talking.
  • Explain your plan at the beginning; recap what you’ve done at the end.
  • Attempt to occasionally make eye contact with your interviewers/aim your camera so you are looking into it while looking at the screen.
  • Plan your space.

As the interviewer:

  • Answer questions as best as you can.
  • Be encouraging. Whiteboarding is difficult!
  • Be patient. Only offer hints if your partner indicates that they need help.
  • Be engaged. Part of this practice is getting used to having someone evaluate your work as your produce it.
  • Offer constructive feedback. Find at least one thing that your partner did well and one thing they could improve at.

Problem

1st Prompt: Given a number n, return the n-th number from the Fibonacci Sequence, also known as the n-th Fibonacci number.

The Fibonacci numbers are the numbers in the following integer sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ...

A visualization of the fibonacci sequence

In other words, each number is the sum of the previous two integers in the sequence. Example: the 3rd number (where n = 3) in the sequence is 1, because it is the sum of 0 and 1 - which are the previous two integers in the sequence.

The Fibonacci sequence always begins with the integers 0 and 1.

Examples:

  • Given: 1, Output: 1
  • Given: 9, Output: 34
  • Given: 10, Output: 55

Further Exploration

  • Write the method via an Iterative Approach via loops.
  • Write another method that solves the same problem, but with recursion.