Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Challenge - Backend

Design a parking lot using object-oriented principles

Assumptions

  • The parking lot can hold motorcycles, cars and vans
  • The parking lot has small spots, medium spots and large spots
  • A motorcycle can park in any spot
  • A car can park in a medium spot or a large spot
  • A van can park only in a large spot
  • Only one motorcycle cah fit in a small spot
  • Two motorcycles can fit in one medium spot
  • Four motorcycles can fit in one large spot
  • Only one car can fit in a medium spot
  • Two cars can fit in a large spot
  • Only one van can fit in a large spot

Functionality needed

  • Ability to add vehicles by type. Once added it should deduct accordingly from total slots
  • Ability to tell us how many spots are remaining by vehicle type or by all types
  • Ability to tell us if the lot is full

Your solution

  • You can add any classes or methods you would like to display your solution
  • Your solution should be in TypeScript
  • Display best practices using object oriented programming
  • Submit your code by a Github repository

Solution endpoints

  • /pl -> Return parking lot as JSON.
  • /park -> Park a vehicle. Body: standard body (shown ahead)
  • /available -> Chech for available spots for given vehicle. Body: standard body (shown ahead)
  • /isFull -> Park a vehicle.

Standard body:

{
  "vehicle": "car"
}

Vehicle can be "motorcycle", "car" or "van"

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages