car-parking-formio
v1.0.1
Published
Coding Exercise For Candidates
Downloads
3
Readme
coding-exercise
Coding Exercise For Candidates
Car Park Management System Coding Exercise
Task Description:
You are tasked with building a simple car park management system in Node.js using TypeScript. The system should allow users to add cars to the car park, remove cars from the car park, and list all cars currently parked. You have one hour to complete the task. Focus on implementing the core functionalities first, and then consider additional features if time allows.
Requirements:
- Use TypeScript for the implementation.
- Implement the following functionalities:
- Add Car: Allow users to add cars to the car park. Each car should have a unique registration number and a color.
- Remove Car: Allow users to remove a car from the car park based on its registration number.
- List Cars: Display a list of all cars currently parked in the car park, showing their registration numbers and colors.
- Ensure error handling for invalid inputs and edge cases.
- Write clean and maintainable code with proper documentation and comments.
Instructions:
- Fork Repository: Fork the provided repository to your GitHub account.
- Setup: Clone the forked repository and set up a new Node.js project with TypeScript.
- Implementation:
- Define a Car class with properties for registration number and color.
- Implement a CarPark class with methods for adding cars, removing cars, and listing cars.
- User Interaction:
- Use command-line interface (CLI) or
stdin
for user input. - Allow users to interactively add, remove, and list cars.
- Use command-line interface (CLI) or
- Error Handling:
- Handle invalid inputs such as duplicate registration numbers or removing non-existent cars.
- Testing:
- Write tests to ensure the implemented functionalities work correctly.
- Documentation:
- Provide comments and documentation to explain your code's logic and any algorithms used.
- Completion:
- Aim to complete the core functionalities within one hour.
- If you finish early, consider adding optimizations or additional features.
Submission:
- Commit your changes to your forked repository.
- Submit your solution sharing the link of your forked repository via Linkedin.
- Include any necessary instructions for running the program.
- Provide a brief explanation of your design choices and any trade-offs made.
Note:
- Focus on completing the core functionalities within the given time frame.
- Write clean, understandable code with proper error handling and documentation.
- Test your program with various scenarios to ensure it works correctly.
- Good luck, and feel free to ask any questions if you need clarification!