Git Product home page Git Product logo

root0109 / parkinglot Goto Github PK

View Code? Open in Web Editor NEW
45.0 3.0 60.0 113 KB

This is one of the solutions to popular code and design problem asked in many of the companies like Thoughtworks, Gojek, Amazon etc. This question has all the ingredients to test a candidate's design skills to build a scalable system. More testcases and features can be added to it based on the requirement. problem statement is described in attached reference.

Home Page: https://medium.com/@vaibhav0109/design-problem-parking-lot-2617785a8ef7

Shell 0.61% Java 99.39%

parkinglot's Introduction

GOJEK Parking lot Problem

Project Requirements

  • JDK 1.8.

  • Maven 2.

  • Junit 4.12

The project can be run as follows in one of the two ways :

  1. ./parking_lot.sh <input_filepath>
    The inputs commands are expected and taken from the file specified
  2. ./parking_lot.sh This will start the program in interactive mode.

parkinglot's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

parkinglot's Issues

[Question] Automatic bus seat allotment solution the basis of parking lot

I have an query, how should I handle automatic bus seat allocation problem on similar lines to parking lot problem.
Problem description:

  • There are 3 x 2( 3 by 2) seats in bus with X capacity.
  • Each row contains 5 seats from which 2 seats are Window seats.

Conditions:

  1. If I have given an input to system to book one seat then preference should go to window seat.
  2. If I have given an input to system to book two seats then 2 seats from double seat( two seats section of 3 by 2 seats ) should be booked.
    and so on...
  3. If no window seats are available then system should give preference to middle seats.

I have to implement something like NearestFirstParkingStrategy but not sure how to achieve same.
I would highly appreciate if I can get some idea on what collections/implementation strategy should be used and time complexity using same etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.