Skip to content

Instantly share code, notes, and snippets.

@matehat
Last active November 22, 2015 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matehat/a88fd45385b63ce60b6b to your computer and use it in GitHub Desktop.
Save matehat/a88fd45385b63ce60b6b to your computer and use it in GitHub Desktop.
Invotas Challenge

The response to this challenge should come in the form of links to JSFiddles for 1 and 2, and to a Pastebin for 3.

1. Stylesheets and HTML

Using JSFiddle, create a <ul> element and 4 <li> children elements, and position them in order to meet the following constraints, without the help of external CSS libraries:

  1. The 4 children should each be using 20% of the available width
  2. They should be evenly spread horizontally.
  3. They should have different height
  4. They should be vertically aligned with respect to their Y centers.
  5. If I go and change the height of one of the <li>, the alignment should still work.

Bonus: Make the <li> element shake vertically using CSS only.

2. Functional Javascript

Using JSFiddle still, make a function that uses lo-dash to process a list, such that if given this one as argument:

var people = [
  { name: "Mathieu", age: 29 },
  { name: "Yvon", age: 54 },
  { name: "Chris", age: 49 } // :)
]

would return the string "Yvon and Chris" (by filtering some elements out based on age, sorting in descending age and joining names into a single string). In other words, this line should be satisfied:

yourFunction(people) == "Yvon and Chris"

3. Erlang

Write a function that takes a number N and returns N! (factorial N).

Hint: Since iteration does not exist in Erlang, you'll have to use a recursive strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment