|
| 1 | +# Elimity backend internship exercise |
| 2 | + |
| 3 | +Thank you for applying for the **Elimity Backend Developer Intern** position! This exercise is designed to give you an |
| 4 | +opportunity to show off your programming skills that would be relevant to work at Elimity, and to give you an idea of |
| 5 | +what type of work you would be doing during your internship. The code in this repository provides a Go module as a |
| 6 | +starting point for the assignments. It implements `gothub`, a simple CLI for tracking public GitHub repositories. The |
| 7 | +actual assignments are listed below. |
| 8 | + |
| 9 | +## Installation |
| 10 | + |
| 11 | +The `gothub` CLI can be installed using `go get` with Go 1.16+: |
| 12 | + |
| 13 | +```sh |
| 14 | +$ go get github.com/elimity-com/backend-intern-exercise/cmd/gothub |
| 15 | +``` |
| 16 | + |
| 17 | +## Usage |
| 18 | + |
| 19 | +```sh |
| 20 | +$ gothub help |
| 21 | +Simple CLI for tracking public GitHub repositories. |
| 22 | + |
| 23 | +Usage: |
| 24 | + gothub help |
| 25 | + gothub track [-interval=<interval>] |
| 26 | + |
| 27 | +Commands: |
| 28 | + help Show usage information |
| 29 | + track Track public GitHub repositories |
| 30 | + |
| 31 | +Options: |
| 32 | + -interval=<interval> Repository update interval, greater than zero [default: 10s] |
| 33 | +``` |
| 34 | + |
| 35 | +## Assignments |
| 36 | + |
| 37 | +Currently `gothub` only supports regularly printing the most recently updated public GitHub repositories. The |
| 38 | +assignments consist of extending its functionality. More specifically, we ask you to implement these improvements: |
| 39 | + |
| 40 | +1. GitHub applies very strict rate limiting for anonymous requests, causing `gothub` to fail when it contacts the API |
| 41 | + too frequently. As stated [here](https://docs.github.com/en/rest/reference/search#rate-limit), the rate limit could |
| 42 | + be increased by using authenticated requests. Therefore we ask you to add a `token-file` option to the `gothub` CLI, |
| 43 | + which should support authenticating requests by reading a |
| 44 | + [GitHub personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) |
| 45 | + read from the given file path. If not provided, `gothub` should stick to anonymous requests. |
| 46 | + |
| 47 | +2. Currently `gothub` only prints repository names. We ask you to extend this to a table-formatted output with columns |
| 48 | + for the repository's owner, name, last update timestamp and star count. If the repository belongs to an organization, |
| 49 | + list the organization's name in the owner column. The result should look like this (including headers): |
| 50 | + |
| 51 | +``` |
| 52 | +Owner | Name | Updated at (UTC) | Star count |
| 53 | +golang | go | 2021-03-08T11:29:52 | 12345 |
| 54 | +google | go-github | 2021-03-07T12:34:56 | 5432 |
| 55 | +angular | angular | 2021-02-29T05:43:21 | 43210 |
| 56 | +``` |
| 57 | + |
| 58 | +3. The repositories outputted by `gothub` are only filtered by their accessibility, as they are all public. We ask you |
| 59 | + to add a `min-stars` option, which causes `gothub` to filter out repositories with a star count below the given |
| 60 | + value. If not provided, `gothub` should use a minimum star count of zero. |
| 61 | + |
| 62 | +### Grading |
| 63 | + |
| 64 | +Your solutions for the assignments will be graded according to the following points: |
| 65 | + |
| 66 | +- compliance with the listed requirements, |
| 67 | +- consistency with the existing code, |
| 68 | +- understanding of Go fundamentals, |
| 69 | +- adherence to Elimity's style guidelines: |
| 70 | + - strong types over implicit assumptions, |
| 71 | + - immutability over mutability, and |
| 72 | + - simple over clever. |
| 73 | + |
| 74 | +### Practicalities |
| 75 | + |
| 76 | +- You can use any library you want, but we prefer the standard library. |
| 77 | +- These practices are important on the job, but won't affect your grades: |
| 78 | + - proper version control, |
| 79 | + - testing (which is complex for a CLI without business logic). |
0 commit comments