Skip to content

Instantly share code, notes, and snippets.

@holmberd
Last active March 20, 2023 17:39
Show Gist options
  • Select an option

  • Save holmberd/1cba768adc5f553cd19bbfc9ff1fe5a5 to your computer and use it in GitHub Desktop.

Select an option

Save holmberd/1cba768adc5f553cd19bbfc9ff1fe5a5 to your computer and use it in GitHub Desktop.
Assignments

Take home Assignments

There are two assignments in this document that are expected to be completed. All of the requirements for an assignment needs to be fullfilled for it the be considered completed.

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

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 change the sort order of the rows a column.

You are free to use whatever libraries you like as long as they align with the requirements. Please do your best to write production-quality code.

Log from: https://en.wikipedia.org/wiki/The_Oregon_Trail_(1971_video_game)

{
  "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" }
  ]
}

Requirements

Application

  • The application should be written in React + Typescript.
  • The application should consume the json data in the log_data.json file.
  • The application should display a table where each row represents an entry in the log_data.json file.
  • The application should contain content that explains the purpose of the page, data and table functionality.
  • The application should display an error if the table fails to load, e.g. missing or corrupt log_data.json file.

User

  • A user should be able to interact with the whole table on a small screen.
  • A user should be able to interact with the whole table on a large screen.
  • A user should be able to order table columns by interaction with the table headers.
  • A user should be able to order table columns by descending order where it makes sense.
  • A user should be able to order table columns by ascending order where it makes sense.

Haiku API

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

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

Requirements

  • Should accept a list of keywords as an argument.
  • Should fetch the Haiku messages from the specified endpoint and print them in order.
  • On success prints messages as an JSON array with the following data structure:
    • message
    • response-code
    • response-time (in milliseconds)
  • On error prints the error message and exists with error code 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment