This is an exercise I did for a company. To successfully complete the job application, you'd have to refactor the project (bike-distributor-refactor) they provided. Your version would need to be flexible, easy to understand and maintainable.
This was my submission.
Here are the instructions that came with the assignment:
Thanks for taking the time to download this refactoring exercise.
Here's the instructions from our CTO:
This solution contains three classes used by an imaginary bicycle distributor to produce order receipts and some unit tests to prove that everything works.
Pretend this code is part of a larger software system and you are given responsibility for it. Assume that there will be at least one type of change coming your way regularly: more bikes at new prices, different discount codes and percentages, and/or additional receipt formats.
Refactor the code so that it can survive an onslaught of the changes you've chosen, you're confident it works, and you're comfortable the next engineer will easily understand how to work on it.
Show us what you can do; you should be proud of what you submit. If we love your refactoring and your resume is legit, we'll move to the next step and do an interview and pair programming session. This might seem like a lot of hoops to jump through, but it's way better than hiring someone who answers trivia questions in an interview well but can't code worth a damn.
Called out Requirements
- Bike prices changes
- multiple discount codes and Percentages
- multiple receipt formats