- Input data is realistically computable on a local machine
- Data is well-formed
- Compute is cheap
- Uses functional patterns for filtering, since it makes it easier to test and more modular
- The complexity is small, but to answer multiple questions requires 0(x*n), where x is the number of questions being asked a. This could be improved upon and made to be O(n), but that adds a bit more complexity
- The test harnessing is great. The actual tests themselves need inline or test-only data, as opposed to relying on the example csv
The intention of this coding challenge is to gauge your ability to program, write clean code, and discuss your work with others. While we would like to see your best work, we don't want you to spend a large amount of your free time optimizing your solution to this challenge. So, our expectation is to receive a well written solution with a clear approach that could potentially have room for improvement. With this in mind, we recommend spending about an hour or two on this challenge.
You are given a very simple log of events(server_log.csv
) for a server that allows users to upload or download files.
Using this log file as example input, write a program in Go that will allow a server administrator to gather metrics from server logs of this format.
Your solution must be able to answer the following types of questions about the example log:
- How many users accessed the server?
- How many uploads were larger than
50kB
? - How many times did
jeff22
upload to the server on April 15th, 2020?
Please include a small README.md
describing your solution and additional considerations you would make if you had more time.
The log is represented by a CSV formatted file where column data is ordered: timestamp
, username
, operation
, size
.
- The
timestamp
is recorded in the UNIX date format. - The
username
is a unique identifier for the user. - The
operation
indicates if anupload
ordownload
occurred, no other values will appear in this column. - The
size
is an integer reflecting file size inkB
.