Skip to content

mantoshkumar1/interview_scheduler

Repository files navigation

Interview Scheduler

This application allows interviewers and candidates to submit their time availabilities for the next week (only) through its RESTful API. Based on the time availabilities of interviewers and candidates, this application calculates the mutually agreeable interview time slots.

How to install the application software requirements:

$ cd interview_scheduler
$ sudo -H pip install -r requirements.txt
This application has been developed and test on Ubuntu 16.04 LTS OS using Python2.7. For other OS platform, few instructions might need to be adapted.

How to run the application server

$ cd interview_scheduler
$ export PYTHONPATH=$PWD
$ python run_scheduler.py

REST API Endpoints

How to reset the application before its usage

$ curl -d '{}' -H "Content-Type: application/json" -X POST http://localhost:5000/reset_scheduler

URI: http://localhost:5000/reset_scheduler
Method: POST
Content-Type: application/json
Body:

{ }

Response:

{
    "Status": "Content of previous week is deleted from DBs. Application is now ready for use."
}

How does a candidate submit his time availability to the application through RESTful API

$ curl -d '{"name":"Candidate Name", "email":"[email protected]", "day": "Monday", "start_time": "13:20", "end_time": "14:00"}' -H "Content-Type: application/json" -X POST http://localhost:5000/candidate_schedule

URI: http://localhost:5000/candidate_schedule
Method: POST
Content-Type: application/json
Body:

{
    "name": "Candidate Name",
    "email": "[email protected]",
    "day": "Monday",
    "start_time": "13:20",
    "end_time": "14:00"
}

Response:

{
    "candidate_id": 1,
    "day": "Monday",
    "end_time": "14:00",
    "start_time": "13:20"
}

A candidate can submit multiple time availabilities in the similar manner.

How to get the submitted time availabilities of all candidates through RESTful API

$ curl -X GET http://localhost:5000/candidate_schedule

URI: http://localhost:5000/candidate_schedule
Method: GET
Response:

{
    "candidates_schedules": [
        {
            "candidate_id": 1,
            "day": "Monday",
            "end_time": "14:00",
            "start_time": "13:20"
        }
    ]
}

How does an interviewer submit his time availability to the application through RESTful API

$ curl -d '{"name":"Interviewer Name", "email":"[email protected]", "day": "Monday", "start_time": "13:20", "end_time": "14:00"}' -H "Content-Type: application/json" -X POST http://localhost:5000/emp_schedule

URI: http://localhost:5000/emp_schedule
Method: POST
Content-Type: application/json
Body:

{
    "name": "Interviewer Name",
    "email": "[email protected]",
    "day": "Monday",
    "start_time": "13:20",
    "end_time": "14:00"
}

Response:

{
    "day": "Monday",
    "emp_id": 1,
    "end_time": "14:00",
    "start_time": "13:20"
}

An interviewer can submit multiple time availabilities in the similar manner.

How to get the submitted time availabilities of all interviewers through RESTful API

$ curl -X GET http://localhost:5000/emp_schedule

URI: http://localhost:5000/emp_schedule
Method: GET
Response:

{
    "employees_schedules": [
        {
            "day": "Monday",
            "emp_id": 1,
            "end_time": "14:00",
            "start_time": "13:20"
        }
    ]
}

How to evaluate the agreeable time schedule for a candidate with a list of interviewers

$ curl -d '{"candidate_email": "[email protected]", "interviewers_email": "[email protected], [email protected]"}' -H "Content-Type: application/json" -X POST http://localhost:5000/schedule_interview

URI: http://localhost:5000/schedule_interview
Method: POST
Content-Type: application/json
Body:

{
    "candidate_email": "[email protected]",
    "interviewers_email": "[email protected], [email protected]"
}

A sample of response returned by above POST RPC:

{
    "candidate_email": "[email protected]",
    "day": "Monday",
    "end_time": "14:30",
    "interviewers_emails": "[email protected], [email protected]",
    "start_time": "12:30"
}

How to get the already scheduled interviews through RESTful API

$ curl -X GET http://localhost:5000/schedule_interview
URI: http://localhost:5000/schedule_interview
Method: GET
Response:

{
    "scheduled_interviews": [
        {
            "candidate_email": "[email protected]",
            "day": "Monday",
            "end_time": "14:30",
            "interviewers_emails": "[email protected], [email protected]",
            "start_time": "12:30"
        }
    ]
}

HTTP Error Codes

400, 403, 404, 409, 500

How to run a demo use case

First run the application server in a terminal and execute the following command in another terminal.
$ cd interview_scheduler
$ sh demo_usecase_run.sh

How to execute unit tests for the application

$ cd interview_scheduler
$ python -m unittest discover

Notes regarding format of candidate_schedule, emp_schedule and schedule_interview form fields

All fields anticipates values in string format.

  • "name": Name of a candidate or an interviewer, e.g; "Test Test".
  • "email": We trust users to provide a valid email address, e.g; "[email protected]".
  • "day": The value must belongs to one of these - "Monday", "Tuesday", "Wednesday", "Thursday", or "Friday".
  • "start_time" and "end_time": Provide these values in 24 hours HH:MM format, e.g; "05:30"
  • "candidate_email": It must be a string
  • "interviewers_emails": The email addresses of interviewers should be seprated by comma

Releases

No releases published

Packages

No packages published