Skip to content

Instantly share code, notes, and snippets.

@holmberd
Last active March 20, 2023 17:39
Show Gist options
  • Save holmberd/1cba768adc5f553cd19bbfc9ff1fe5a5 to your computer and use it in GitHub Desktop.
Save holmberd/1cba768adc5f553cd19bbfc9ff1fe5a5 to your computer and use it in GitHub Desktop.
Assignments

Exercises

There are two exercises in this document that are expected to be completed.

The source-code for each exercise should live in a separate repository, Github or GitLab, and should be accessible to the reviewer of the assignment. Each repository should contain a README file explaining the purpose of the repository and how to run it locally.

For each exercise you are free to use whatever libraries and technologies you like, but a combination of Javascript/Typescript/React is preferred for the first exercise, and Nodejs/PHP for the second.

Please do your best to write production-quality code.

Once completed, links to both of the repositories should be sent to: [email protected]

Log Viewer

Build a single JavaScript application that consumes data from a log_data.json file and renders it as an HTML table on the page. Please add a usable header to the table and some additional content to the page to explain the purpose of the page and the data. A user should be able to interact with the table headers to sort rows by its column.

log_data.json:

{
  "success": true,
  "logs": [
    { "datetime": "2013-10-15T19:15:05", "type": "ERROR", "name": "Death", "message": "Nicole has died of dysentry", "source": "com.devcpu.oregontrail.uhoh" },
    { "datetime": "2013-10-15T19:14:05", "type": "WARN", "name": "Injury", "message": "Mary has a broken arm", "source": "com.devcpu.oregontrail.whoops" },
    { "datetime": "2013-10-15T19:12:05", "type": "INFO", "name": "Birth", "message": "Janet gave birth to twins", "source": "com.devcpu.oregontrail.uhoh" },
    { "datetime": "2013-10-15T19:11:05", "type": "WARN", "name": "Broke down", "message": "Your wagon has broken a wheel", "source": "com.devcpu.oregontrail.wheeeeeel" },
    { "datetime": "2013-10-15T12:10:05", "type": "ERROR", "name": "Death", "message": "6 of your oxen have perished overnight!", "source": "com.devcpu.oregantrail.oxentoxin" },
    { "datetime": "2013-10-15T10:09:05", "type": "INFO", "name": "Crossing", "message": "You are faced with crossing a large river.", "source": "com.devcpu.oregantrail.gumboots.betterHavePacked" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "Traveller", "message": "Judas has joined your group", "source": "com.devcpu.oregantrail.start" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "Traveller", "message": "Jesus has joined your group", "source": "com.devcpu.oregantrail.start" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "Traveller", "message": "Sarah has joined your group", "source": "com.devcpu.oregantrail.start" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "Traveller", "message": "Nicole has joined your group", "source": "com.devcpu.oregantrail.start" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "PackedItem", "message": "You have decided to pack 5 chickens", "source": "com.devcpu.oregantrail.packinTime" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "PackedItem", "message": "You have decided to pack a knife", "source": "com.devcpu.oregantrail.packinTime" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "PackedItem", "message": "You have decided to pack an axe", "source": "com.devcpu.oregantrail.packinTime" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "PackedItem", "message": "You have decided to pack 20 cast iron pans", "source": "com.devcpu.oregantrail.packinTime" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "PackedItem", "message": "You have decided to pack bullets", "source": "com.devcpu.oregantrail.poorBuffalo" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "PackedItem", "message": "You have decided to pack a rifle", "source": "com.devcpu.oregantrail.poorBuffalo" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "PackedItem", "message": "You have decided to pack 10 oxen", "source": "com.devcpu.oregantrail.packinTime" },
    { "datetime": "2013-10-15T09:05:05", "type": "INFO", "name": "Start", "message": "You have started your journey", "source": "com.devcpu.oregantrail.start" }
  ]
}

Haiku API

Build a command-line application that retrieves Haiku messages from the specified endpoint and prints them in order.

API Endpoint: https://haiku.kremer.dev/?keyword=stanza

Input

  • A list of keywords as arguments.

Output

  • On success prints messages as an JSON array with the following data structure:
    • message
    • response-code
    • response-time (in milliseconds)
  • On error prints an error message and exits with error code 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment