This is the exercise for the Web Developer position at LOGIC. The objective of this exercise is to create a web application in the programming language of your choice.
- Create a new private repository using this template1.
- Add the following GitHub users as collaborators: @akalipetis, @parisk, @EvelinaIo.
- Create a new branch for your implementation2.
- Implement the exercise in your new branch.
- Create a Pull Request with your implementation3 and add @parisk as a reviewer4.
You should spend no more than 4 hours working on this exercise. We will by no means police you, but we do trust you to respect and comply with this constraint.
You should submit your Pull Request no later than 7 calendar days after you receive the email from us inviting you to participate in it.
Your submission should:
- Implement the spec
- Document the implementation
In case you finish your implementation early, you can:
- Dockerize your repository
- Implement at least one automated test (e.g. unit test)
This is the functionality of the web application we expect you to create. It should include an HTML page and an API endpoint.
- This is the page the user sees, when they open the web application
- This page contains a form with:
- A text area
- A submit button
- An empty div element for results
- When the form is submitted:
- The submit button should be disabled and it's text should be set to
Loading...
. - The value text area should be submitted to the
/api/sort/
endpoint as a JSON list (each line in the text area corresponds to a JSON list element).
- The submit button should be disabled and it's text should be set to
- When the API endpoint responds:
- The button should be enabled again, with the original text.
- The sorted results should be displayed the div element for the results.
- This endpoint should receive and array of strings, sort them and return them back
- The sorting algorithm should be Quicksort5 (do not use any libraries or built-in functions for sorting)
- The API endpoint should validate that the correct data (array of strings) has been submitted, otherwise it should return a 400 status code
Your submission should be brief, yet clearly documented. In particular:
- README: The current README file should be replaced with one containing information only about what this web application does and how to run it.
- Code: Each function you write should be documented about what it does and how it works.
If the user enters the text below:
banana
apple
orange
The following JSON request should be made:
POST /api/sort/
[
"banana",
"apple",
"orange"
]
The following JSON response should be returned:
[
"apple",
"banana",
"orange"
]
And the following text should be displayed when the request completes:
apple
banana
orange
All code included here is MIT licensed.
Footnotes
-
https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template ↩
-
https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging ↩
-
https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request ↩
-
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review ↩