View on GitHub

Line Server Problem

In this exercise, you will build and document a system that is capable of serving lines out of a file to network clients. You may do this in any language (although Ruby, Python, Java, JavaScript, or Scala are preferred). You may use any reference and any open-source software you can find to help you build this system, so long as you document your use. However, you should not actively collaborate with others.

Specification

Your system should act as a network server that serves individual lines of an immutable text file over the network to clients using the following simple REST API:

Your server should support multiple simultaneous clients.

The system should perform well for small and large files.

The system should perform well as the number of GET requests per unit time increases.

You may pre-process the text file in any way that you wish so long as the server behaves correctly.

The text file will have the following properties:

Please avoid just putting the file contents into a database. It’s a pretty decent design, but doesn’t leave many lines of code to have a discussion about. We try to encourage people to shoot for something a little more efficient than that (not requiring a copy of all the data).

What to submit

You should submit a zip file or provide access to a public source code repository that contains shell scripts to build and run your system, documentation for your system, and the source code for the system itself.

The remainder of the files in your tree should be the source-code for your system.