Vending Machine Test – C# Developer
Thank you for your application. The exercise below forms part of CME/Elysian’s recruitment and
selection process for this vacancy.
The Task:
A vending machine sells items for various prices and can give change. Write code that models the
machine and implements the following features:
- at the start of the day: loading the machine with coins of various denominations (e.g. 100 x 1p, 50 x 5p, 50 x 10p etc…)
- calculating the change to be given when an item is purchased (e.g. 2 x 20p used to purchase
an item costing 25p might return 1 x 10p and 1 x 5p)
Consideration should be made as to a suitable level of generality as well as other factors such as (but not necessarily limited to) performance, flexibility, maintainability, error conditions. A user interface is not required. Where the problem is unclear the candidate should make any assumptions that they think appropriate.
Along with the code the candidate should provide some documentation (which may simply consist of
comments in the code) describing the solution along with any assumptions that have been made or
limitations in the provided solution.
When evaluating the solution the following factors (amongst others and in no particular order) will be
taken into account:
- simplicity, clarity and readability of code
- correctness and efficiency of algorithms
- class and method structure
- appropriateness of data structures used
- appropriateness of assumptions
- flexibility of design
There is no time-limit but the task should not take much more than an hour. The ideal solution will be
simple and readable, with efficient and well-designed code that fulfils the requirements.
Before you submit:
- Check any of the referenced libraries are causing it to be blocked (a dll extension, PDB or
CACHE) Send an encrypted version of the zip file, which should allow the email to pass
through our mail filter
- Remove or change anything that is .ade, .adp, .bat, .chm, .cmd, .com, .cpl, .exe, .hta, .ins,
.isp, .jse, .lib, .mde, .msc, .msp, .mst, .pif, .scr, .sct, .shb, .sys, .vb, .vbe, .vbs, .vxd, .wsc, .wsf,
.wsh, .rar
Post your thoughts on implementation taking in account that implementation
should not take more than an hour.