Def Method

Apprentice Code Test

Def Method APPRENTICE Code Test



This exercise will provide us with an initial gauge of your programming skills, and more importantly, your overall software development craftsmanship. It's not meant to be long or tricky or complicated. It's not timed, so you can take as long as you need.


In a language of your choice, parse the following set of three input files:


and produce the following output:

Target Output

Click below for more detailed information on:
Code Test Input Files
Code Test Output Info

    What you'll be graded on

    • Correct Output
    • Simplicity
    • Unit testing (output and input)
    • Object Oriented Design Principles / Clean design
    • Readability
    • Ability to follow these instructions

    Include / Don't Include

    • Please include a README file that describes how to build and run the application and its tests.
    • Please additionally include your unit testing framework.
    • Your program may only use the standard libraries which accompany your chosen language's runtime. No other libraries may be used.
    • If you use a build tool (e.g. Ant, nmake, maven, rake, etc.) to build your project, please include the build file as well.
    • You will not need to use a web framework, (Rails, Django, etc.) as the test simply deals with file input and output.
    • If you think the test or instructions could be improved, we welcome your feedback.

    Your Submission

    Solutions should be submitted using the upload link you received via email. If you did not receive an email with this link, please contact
    Your solution should be sent in a zip archive.

    Helpful Hints

    Software architecture:

    Consider what you have learned about object-oriented programming. Think about how you can incorporate it into your code so that it's not only more efficient but also more scalable.

    Along the lines of scalability, think about edge cases that might arise during this exercise and how you might handle it in your code. If you were to hand over your code for someone else to maintain, would they be able to easily follow your train of thought? Are your naming conventions adhering to good semantics?

    Unit testing:

    The most basic elements of a unit tests contains the following:

    • Well defined expectation
    • Verifying expectation against the results of a method

    The following is an example of a unit test in pseudo rspec:

    it 'sorts by first name' do

    zebra ='Zebra')

    paul ='Paul')

    aaron ='Aaron')


    expected_sorted_people = [aaron, paul, zebra]


    sorted_people = sort_pal.sort( [zebra, paul, aaron])


    expect(sorted_people).to eq expected_sorted_people