first round: technical coding test
You will be provided with an input file which defines a graph and a series of questions relating to the graph. Your program will need to read this input file and output the answers to an output file.
Input
The program must accept a single argument, a path to the input file. e.g. "~/input.txt”
The input file will be structured as follows:
The first line will be the graph definition, a single line of routes separated by spaces.
A route will be defined as AC5 (i.e. The distance from A to C is 5).
Following the problem definition each line will represent one of the following questions (The routes included in these questions are examples only).
DISTANCE CBAE What is calculated distance of the route CBAE? The answer should be the route, including distance. i.e. CBAE12
SHORTEST CA What is the shortest route from C to A? The answer should be the route, including distance. i.e. CBA12
POSSIBLE CA15 What are the possible routes from C to A with a maximum distance of 15? The answer should be all routes, including distances, separated by spaces. i.e. CBA8 CBADA12 CBDA11 CBDADA15 CEA12 CBEA15
The input file can contain any number of questions, in any order.
Please find an example ‘input.txt' attached.
Output
Output the answers to a file named 'output.txt', one answer per line, in the following format:
DISTANCE CBAE = CBAE12
The solution should be written in Java.
You may only use external libraries or tools for the purposes of testing and building your program (e.g. JUnit, Ant, Maven).
Keep in mind that the solution is not the only aspect of your code we will be looking for. While we understand that this is a relatively small problem, we expect object-oriented, production quality code that is runnable, testable, extendable and reusable. You do not need to gold-plate your solution, however you should keep in mind potential extensions when designing and developing the solution.
Please submit a zipped file containing the source code and a README file.
The README should contain the following:
A short description of your solution
Any assumptions you have made
Instructions for compiling and running the program as a zipped file.