Giter Club home page Giter Club logo

javascript-developer-exercises's Introduction

javascript-developer-exercises

Some JavaScript developer exercises to use as a pre-screen for job interviews

Just fork this repo (or download it) and look at each of the files in the exercises folder.

What to do

Each exercise will have the shell of some code as well as a description, in comments, as to what you need to add to the code to get the desired result and what the desired result is. It will also tell you how to run the code in Node.js, as well.

You are only allowed to add code between the following comments in an exercise:

// PLACE YOUR CODE BELOW

// PLACE YOUR CODE ABOVE

You can add as many lines as you like, assuming the exercise doesn't specifically restrict that (some do). If there are multiple instances of those code placement pairs, then you can add code within each of them, if you feel the need to.

For example, given the following exercise:

function sayHello(name) {
  // add code here that will take the name param and
  // say hello in the form of "Hello, <Name_Here>!" to the console
  // PLACE YOUR CODE BELOW
  
  // PLACE YOUR CODE ABOVE
}

sayHello('Michael')

// Expected output to the console when run with 'node sample_exercise.js' would be:
// Hello, Michael!

So in this particular case, we're looking for you to modify the code so that it looks something like the following:

function sayHello(name) {
  // add code here that will take the name param and
  // say hello in the form of "Hello, <Name_Here>!" to the console
  // PLACE YOUR CODE BELOW

  console.log('Hello, %s!', name)
  
  // PLACE YOUR CODE ABOVE
}

sayHello('Michael')

It's output when run with the node sample_exercise.js command should be:

Hello, Michael!

There are obviously many ways this could be written. You get to choose how you do things, but we might have opinions as to which solutions we prefer to see. Don't try to make things overly complex, but do make sure that you aren't simply hard-coding an answer. For example, coding the above exercise so that it used console.log('Hello, Michael!') hard coded like that, so that it wouldn't work with a call of sayHello('Jane'), is not acceptable.

Requirements

You will need to have a recent version of Node.js installed to run your code. We make use of some built-in Node modules for testing the results of your code, such as our use of Node's assert.deepEqual() call in exercise 2. You may feel free to use ES6 constructs for your work, as well. Some of the exercises might be ES6-specific, even.

Rules and Expectations

If you don't know how to do something, feel free to look it up and work up a solution. Take as long as you like. This is meant to test your ability to get things done, not necessarily to get things done from memory in a few minutes time. A real development job rarely leaves you disconnected from the internet with only a few minutes to complete a task....

Not all positions require you to be able to solve all exercises. Do what you can.

Submitting your work

Once you have completed your exercises (or as many as you can), email the URL of your forked project or a ZIP file of the actual project to your recruiter so that it may be forwarded on to me. If you aren't using a recruiter, then just send it to your point of contact with my company.

javascript-developer-exercises's People

Contributors

ianrockefeller avatar michaeloryl avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.