Git Product home page Git Product logo

walmart-scheduler's Introduction

MOVIE THEATER SEATING CHALLENGE - 2020

Language used: C++

Program Description:

This program takes an input file containing customer's requests for reserving seats in a movie theater and processes these requests to maximise customer satisfaction and customer safety . This program also takes public safety into account by keeping a buffer of 3 seats and/or a row between two groups of customers. Customer satisfaction is achieved by assigning customers the last available rows and not splitting the groups.

Assumptions:

  1. A good metric for customer satisfaction is that all groups of customers want to be seated as far away from the screen as possible.
  2. The rows furthest from the screen give the most customer satisfaction, and it decreases as the seats assigned are closer to the screen.
  3. A group of people who are booking the tickets want to be seated together, they won't be split.
  4. Since a group is seated together, there is a limit of 20 tickets per booking, this also helps in handling misuse of tickets.
  5. The reservation requests that arrive first should be handled first. (First Come First Serve)

Algorithm:

The algorithm takes a Greedy approach by starting the seat assigning process from the first available seat in the farthest row possible and then moving forward.

Complexity:

All the operations are linear in terms of the array, but since only 200 seats are there, it is O(1) time and O(1) space.

Future enhancements:

  1. Customers should be able cancel/change their seats.
  2. Fitting in as many customers as possible by splitting groups of people when consecutive seats are unavailable.

Run program:

Step 1 -> Create Executable File g++ -std=c++20 -o main main.cpp

Step 2 -> Run Executable ./main </path/to/file>

Run Tests:

Step 1 -> Create Test Executable File g++ -std=c++20 -o test TestsDriver.cpp

Step 2 -> Run Executable ./test

walmart-scheduler's People

Contributors

nikhilkala avatar

Watchers

 avatar

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.