0% found this document useful (0 votes)
51 views

Flurn Assignment - Backend Developer

The document outlines an assignment to build a backend booking service using Golang or NodeJS. It specifies APIs to get seat data, retrieve pricing based on occupancy, create bookings, and retrieve user bookings. It provides sample data and instructions to populate the database. The assignment is due in 7 days and will be processed in order of submission. Bonus features include notification integration and a data loading script.

Uploaded by

Dual Dave
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Flurn Assignment - Backend Developer

The document outlines an assignment to build a backend booking service using Golang or NodeJS. It specifies APIs to get seat data, retrieve pricing based on occupancy, create bookings, and retrieve user bookings. It provides sample data and instructions to populate the database. The assignment is due in 7 days and will be processed in order of submission. Bonus features include notification integration and a data loading script.

Uploaded by

Dual Dave
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Backend Service Development

# Objective
Build a Booking Service which allows you to choose seats and book.

# Technology stack to be used

1. Any Golang web framework or NodeJS framework


2. Data store - Postgres or Mysql or any other
3. Hosting:
a. Option 1 - Host it on AWS or GCP and expose the endpoint
b. Option 2 - Containerize using Docker
4. Share the code via Github or Bitbucket or Gitlab
5. Test the app using any REST client such as Postman. Share the Postman
collection of the REST APIs created.
6. Deadline - 7 days from receiving the assignment
7. Assignments will be processed on first come first order. So try to submit as
soon as possible as we have limited positions open.

# Assignment Specs:
A list of seats and the seat class will be provided. Every seat class will have
associated pricing with it. Pricing will be in the format of min price max price and
normal price.
During the booking process when Seat is selected we should retrieve the pricing
for that seat based on the number of bookings that have already happened for
that seat class. If the seats in that particular class that was chosen are 60% full,
then use the max price for all further seats booked. If the seats in the particular
class that was chosen are 40% to 60% full, then use the normal price for the seat
booking. If the seats of the particular class that was chosen for less than 40% then
choose the min price.

APIs to be build

# Get All Seats


GET /seats
Return all the seats, ordered by the seat class and also return a boolean is_booked
for every seat.

# Get Seat pricing


GET /seats/id
Return the seat details along with the pricing for the seat based on the class.

Note: The pricing should be returned based on the bookings previously made for
that seat class.
● Less than 40% of seats booked - use the min_price
● 40% - 60% of seats booked - use the normal_price
● More than 60% of seats booked - use the max_price

# Create Booking
POST /booking
Create a booking for the selected seats.
Accept an array of seat ids to be booked, name and phone number of the user.
Create a booking if those seats are not previously booked. Return relevant error
message if any seats chosen are already booked.
Upon successful booking, return the booking ID, and the total amount of the
booking.
# Retrieve Bookings
GET /bookings?userIdentifier=<email or phone number>
Return all bookings created by the user. The API should search by email or phone
number. Any one has to be provided. Return error if no user identifier is provided.

# Bonus features
1. Notification Integration: Send out booking confirmation notification (Email
or SMS) when the booking is created. You can use third-party service
providers like Twilio, Sendgrid, Textlocal etc.
2. Write a script to upload the default data to your database by reading the
CSV file.

Data for Seats (Please export these as CSV files and use)
1. Seat List - Seats
2. Seat Pricing - SeatPricing

If you have any questions feel free to drop a mail at [email protected]

You might also like