Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 2.62 KB

README.md

File metadata and controls

50 lines (31 loc) · 2.62 KB

QMetric Java Exercise

Our Java coding exercise is inspired by PragDave Supermaket Kata.

[...] to experiment with various models for representing money and prices that are flexible enough to deal with [a variety of] pricing schemes, and at the same time are generally usable (at the checkout, for stock management, order entry, and so on).

The task

Your task is to write a component that can calculate the total amount to pay for a supermarket basket.

The products added to a supermarket basket can be priced by unit or by weight.

The supermarket would like to offer pricing discount schemes, for example:

  • Buy one, get one free
  • Buy two items for £1
  • Buy three items for the price of two

First and foremost this is an opportunity for you to demonstrate your software design skills within a small problem space.

Please read through the description carefully and implement a solution that includes at least one of the pricing discount schemes described.

We would like you spend no more than one hour on this task. We have provided this outline Maven project with a simple model for you to use and refactor as you feel appropriate. The rest is up to you.

We are looking for...

  • Clean, tidy, tested, and working code (with accurate pricing calculations)
  • Use of appropriate design patterns and SOLID principles
  • Small incremental changes with good comments, as demonstrated in your commit history

Above all, we would rather see a small codebase with fewer features than failure to observe the points above.

You may add any libraries you feel are appropriate. But we don't expect to see databases or other persistence layers, dependency injection frameworks, web servers, REST APIs, or web frameworks; we are not looking for a fully functioning supermarket system!

Tips

  • Plan your time before you start coding. Start small and add features incrementally
  • Focus on the pricing model and the behaviour of your components -- you only need to demonstrate that your design works, rather than an exhaustive model of numerous supermarket items
  • If you run out of time, describe your intentions in the NOTES.md file

We really don't want you to over-engineer the solution -- and you really don't have time for that! -- but be prepared to extend the functionality in the next step of the interview process.

Submission

Clone or fork this project into a publicly accessible git repository of your own, and email the URL to to [email protected].

Good Luck!