PhonePe Machine Coding Problem
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-10-07Added By Anonymous
Source: Link
🧭 Experience: unknown
✅ Outcome: unknown
💰 Compensation: unknown
📍 Location: unknown
🏢 Company: PhonePe
🎓 Education: unknown
🎁 Benefits: unknown
📅 Offer Date: unknown
Design and implement a restaurant booking system similar to that of Zomato or DineOut
Problem Statement
You need to design a system that allows user to search a restaurant and book a table for n people in a restaurant
There are 3 parts to this problem statement. “registerRestaurant”, “searchRestaurant” and “bookTable”.
RegisterRestaurant : Any restaurant owner should be able to come on the platform and register a restaurant. Restaurants should be able to also provide the slots when it is available for bookings,
SearchRestaurant : Any logged in user, should be able to search a restaurant based on city, area, cuisine, restaurantName, cost for two, veg/non-veg etc
BookTable : Once the user is done searching the restaurant, he/she should be able to book a table for n people in the restaurant if the table and slot is available for the booking date. For simplicity, you can assume all tables in the restaurant are eligible for n people and only 1 hour time slots are allowed for booking. Bookings only allowed for upto m days in future
Examples
registerRestaurant(name, city, area, ……..);
updateTimeSlots(...);
searchRestaurant(loggedInUserId...);
**If needed, you can implement multiple searchRestaurant methods
bookTable(restaurantId, noOfPeople, …..);
**Any other supporting methods if needed
Requirements P0
Make your library/interfaces generic enough to be used for hotel booking in future if needed
You should have a working code that demonstrates the same.
Handle error scenarios appropriately
Concurrency handling for multiple parallel booking requests
Things to keep in mind
You are NOT allowed to use any databases
You are NOT required to have a full-fledged web service or APIs exposed
A working code is needed. So ensure you time yourselves accordingly
You are required to showcase the working of the above concept
Just a main class that simulates the above operations is enough
How you will be evaluated
Separation of concerns
Abstractions
Application of OO design principles
Testability
Code readability
Language proficiency
[execution time limit] 12 seconds (java)
✅ Outcome: unknown
💰 Compensation: unknown
📍 Location: unknown
🏢 Company: PhonePe
🎓 Education: unknown
🎁 Benefits: unknown
📅 Offer Date: unknown
Design and implement a restaurant booking system similar to that of Zomato or DineOut
Problem Statement
You need to design a system that allows user to search a restaurant and book a table for n people in a restaurant
There are 3 parts to this problem statement. “registerRestaurant”, “searchRestaurant” and “bookTable”.
RegisterRestaurant : Any restaurant owner should be able to come on the platform and register a restaurant. Restaurants should be able to also provide the slots when it is available for bookings,
SearchRestaurant : Any logged in user, should be able to search a restaurant based on city, area, cuisine, restaurantName, cost for two, veg/non-veg etc
BookTable : Once the user is done searching the restaurant, he/she should be able to book a table for n people in the restaurant if the table and slot is available for the booking date. For simplicity, you can assume all tables in the restaurant are eligible for n people and only 1 hour time slots are allowed for booking. Bookings only allowed for upto m days in future
Examples
registerRestaurant(name, city, area, ……..);
updateTimeSlots(...);
searchRestaurant(loggedInUserId...);
**If needed, you can implement multiple searchRestaurant methods
bookTable(restaurantId, noOfPeople, …..);
**Any other supporting methods if needed
Requirements P0
Make your library/interfaces generic enough to be used for hotel booking in future if needed
You should have a working code that demonstrates the same.
Handle error scenarios appropriately
Concurrency handling for multiple parallel booking requests
Things to keep in mind
You are NOT allowed to use any databases
You are NOT required to have a full-fledged web service or APIs exposed
A working code is needed. So ensure you time yourselves accordingly
You are required to showcase the working of the above concept
Just a main class that simulates the above operations is enough
How you will be evaluated
Separation of concerns
Abstractions
Application of OO design principles
Testability
Code readability
Language proficiency
[execution time limit] 12 seconds (java)