Skip to content

Farmio-io/coding-exercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

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:
    1. Add Car: Allow users to add cars to the car park. Each car should have a unique registration number and a color.
    2. Remove Car: Allow users to remove a car from the car park based on its registration number.
    3. 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:

  1. Fork Repository: Fork the provided repository to your GitHub account.
  2. Setup: Clone the forked repository and set up a new Node.js project with TypeScript.
  3. 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.
  4. User Interaction:
    • Use command-line interface (CLI) or stdin for user input.
    • Allow users to interactively add, remove, and list cars.
  5. Error Handling:
    • Handle invalid inputs such as duplicate registration numbers or removing non-existent cars.
  6. Testing:
    • Write tests to ensure the implemented functionalities work correctly.
  7. Documentation:
    • Provide comments and documentation to explain your code's logic and any algorithms used.
  8. 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!

About

Coding Exercise For Candidates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published