Skip to content

Instantly share code, notes, and snippets.

@cahinton88
Last active April 11, 2018 20:43
Show Gist options
  • Save cahinton88/ef85794c13a2bfc74defa857b64e743d to your computer and use it in GitHub Desktop.
Save cahinton88/ef85794c13a2bfc74defa857b64e743d to your computer and use it in GitHub Desktop.

Structured Study Program Teaching Mentor Assistant Sample Recording

Thanks for your interest in the Prep Teaching Assistant role for SSP! We're asking all candidates to submit a short video of themselves (screencasting) and live coding and explaining their solution to the following problem. Remember that the target student audience are beginners, many will have only completed Udacity's Intro to JS. As such,assume your audience has an understanding of JS data structures, conditionals, iteration, and functions.

Send your video link, along with a copy of your resume to alex.hinton@hackreactor.com Thanks!

Problem 1: Greet Customers

Write a function called "greetCustomer".

Given a name, "greetCustomer" returns a greeting based on how many times that customer has visited the restaurant. Please refer to the customerData object.

The greeting should be different, depending on the name on their reservation.**

Case 1 - Unknown customer ( Name is not present in customerData ):

var output = greetCustomer('Terrance');
console.log(output); // --> 'Welcome! Is this your first time?'

Case 2 - Customer who has visited only once ( 'visits' value is 1 ):

var output = greetCustomer('Joe');
console.log(output); // --> 'Welcome back, Joe! We're glad you liked us the first time!'

Case 3 - Repeat customer: ( 'visits' value is greater than 1 ):

var output = greetCustomer('Carol');
console.log(output); // --> 'Welcome back, Carol! So glad to see you again!'

Notes:

  • Your function should not alter the customerData object to update the number of visits.

  • Do not hardcode to the exact sample data. This is a BAD IDEA:

      if (firstName === 'Joe') {
        // do something
      }
    

Starter Code :

var customerData = {
  'Joe': {
    visits: 1
  },
  'Carol': {
    visits: 2
  },
  'Howard': {
    visits: 3
  },
  'Carrie': {
    visits: 4
  }
};

function greetCustomer(firstName) {
  var greeting = '';
  
    // your code here
  
  return greeting;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment