Skip to content

Instantly share code, notes, and snippets.

@itsmikeq
Created June 24, 2016 01:27
Show Gist options
  • Save itsmikeq/be7872de20cb89b11ff7d0012aa728fa to your computer and use it in GitHub Desktop.
Save itsmikeq/be7872de20cb89b11ff7d0012aa728fa to your computer and use it in GitHub Desktop.

Thanks for taking the time to take our Fullscreen code challenge!

Please post your answers to a JSBin within a week of receiving this test. Feel free to use whichever compiled-to-JS language you want (Coffeescript, ES6/Babel, vanilla Javascript, etc..), but be prepared to explain what your code compiles down to in plain ol' Javascript if you do.

Getting classy.

  • Create a Vehicle class with getName and setName methods which manipulate a name property on its class instances.
  • Write a getter/setter for wheels and seats using the get/set keywords if your language of choice supports them (pro-tip: it probably does).
  • Create Car and Motorcycle classes which extend from Vehicle and set the number of seats/wheels appropriately.
  • Instances should be properly inherit from your class, so myCarInstance instanceof Car should return true.

UI Time!

  • Add a dropdown that lets a user select a vehicle type and an input to name the vehicle.
  • Add a <ul> on the page to contain a list of vehicles
  • Add a "create" button that adds an instance of the selected vehicle to the <ul> with the entered name.
  • Inside each list item, print the vehicle's name, and add an "info" button which, when clicked, console.logs the text "I am {{ vehicle name}}, a {{ type of vehicle }} with {{ number of wheels }} wheels, and {{ number of seats }} seats!"

Do's and Don'ts

  1. Do use a UI framework if you want. Be prepared to explain, in broad strokes, what the framework is doing under the hood.
  2. Limit your use of global variables (you can use a single namespace). However, we won't ding you for variables created by your framework of choice ($, angular, or react).
  3. Don't spend more than an hour on this; we value working code, not perfect code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment