This coding challenge is based on a basic Javascript program which lets a user:
- add a user by username
- add a company by company name
A few issues has been left unresolved for you fix. A set of requirements has been set up in order to pass, along with an open ended "refactoring" challenge. Please read through this document before starting the challenge, as both the requirements and refactoring should be planned out before taken on.
This is a list of requirements which includes both bug fixes and some feature development.
- Users are created with a userId of 1. Change this so that a userId will never be duplicated.
- Usernames should be unique. Add a check which prohibits duplication.
- Companes are created with a companyId of 1. Change this so that a userId will never be duplicated.
- Add a menu item which lets the user attach a user to a company.
- Add a menu item to list users & companies.
The other part of this challenge is changing the code to make it both scalable and testable. It's up to you how you achieve this, but keep in mind that it should be easily testable (unit/integration tests) and allow us to add a feature without changing any existing code.
The program was built with an older version of javascript to lower the entry level barrier. There is nothing in this test that keeps you from completely rebuilding it with a newer version (like ES6 and/or Typescript), as long as you fulfill the requirements. Good luck!