difficult_bootcamp_questions

Whether you are applying to App Academy, Fullstack Academy, Codesmith, or another bootcamp, there are 3 types of programming questions you will encounter in your technical interview:

  1. Questions that you 100% know how to answer
  2. Questions that you aren't sure how to answer at first but can get there with a little bit of work
  3. Questions that completely stump you

You want every question to be in the 1st category. However, most questions will fall within the 2nd or 3rd categories. An example of a question in the 2nd category might look like:

// Given a positive integer as an argument, write a function that logs every number from 1 up to and including the argument to the console. Instead of printing the number, log “Fizz” to the console if the number is divisible by 3, “Buzz” if it's divisible by 5, and “FizzBuzz” if it's divisible by both.

An example of a question in the 3rd category might look like:

// Using recursion, create a function that takes an array as an argument and returns a brand new array with all the items from the array and sub arrays flattened into a single array. The arguement can contain numbers, letters, or other arrays.

At first glance, these problems may seem confusing, but they are actual questions asked in bootcamp interviews. When you get a problem in the 2nd or 3rd category, the trick to solving them is to take a deep breath, ask clarifying questions, and write pseudocode before you start writing code.

Clarifying Questions


When you are not sure how to approach a problem, the first thing you should do is ask clarifying questions. Make sure you understand what arguments a function takes in and what it’s supposed to return. Clarifying questions give you time to think and also gain a better understanding of the problem. Overall, it’s better to take the few minutes to ask questions than to jump into a problem that you don't fully understand.

Pseudocode


Pseudocode is a way to write code in plain English. When you write pseudocode, you write down a detailed approach to a problem before you start writing the code. Writing pseudocode before you write actual code allows you to think through a problem without having to worry about the syntax and provides you a roadmap for when you do write your code. Let’s take a look at an interview problem and then see how we would write in pseudocode:

Problem

// Given a positive integer as an argument, write a function that logs every number from 1 up to and including the argument to the console. Instead of printing the number, log “Fizz” to the console if the number is divisible by 3, “Buzz” if it's divisible by 5, and “FizzBuzz” if it's divisible by both.

Now, let’s break this problem down into pseudocode so we have a roadmap for when we write our actual code.

Pseudocode

// Loop over every number from 1 up to and including the argument.

// Inside loop, check to see if the number is divisible by 3, 5, or both. Can use a modulo operator to get the remainder.

// If number is divisible by 3, log “Fizz”. If divisible by 5, log “Buzz”. If divisible by both, log “FizzBuzz”.

Now we have the entire FizzBuzz problem broken down into 3 steps and all we have left to do is write our function. Additionally, writing pseudocode gives you an opportunity to explain your thought process to your interviewer. I use pseudocode all the time in the Programming Bootcamp Interview Prep course to break down complex problems into digestible chunks for students. Additionally, explaining your thought process allows you to include the interviewer in the programming process and highlight your communication skills. Although you want to solve the problems given, good communication skills will definitely make you stand out from the rest of the applicants.



This article was written as part of the Coding Bootcamp Prep course. The course is dedicated to providing people of all skill levels the knowledge they need to get admitted to the country's top coding bootcamps.