PhonePe | Software Engineer (Backend) | Machine Coding
Company: PhonePe
Role: Software Engineer (Backend)
Interview Stage: Machine Coding
Location: unknown
Year: unknown
Original Post Content:
YOE: 2 years
Was given two hours to code this as an assignment. Question was held on codesignal, but you could use any IDE of your preference. You just need to mail the code. Interview was held 5 days later after submitting this assignment. You have to go through your code and explain your design.
Interviewer will judge you on the basis of your code quality, were you able to make it executable.
If you need C++ code for this just drop your email/linkedin/whatever. I can send you.
Verdict: was able to move to second round.
<hr />Objective: Design and implement an application to allow users to choose and book fitness classes. The application should cater to user management, class scheduling, and booking, including waitlisting and cancellation features.
Requirements:
User Management:
- Registration and Login: Users should be able to register and log in to the system.
- User Tiers: Users can be categorized into three tiers: Platinum, Gold, and Silver. Each tier has a different booking limit:Platinum: 10 classesGold: 5 classesSilver: 3 classes
- Packages: The user tiers align with the packages, determining the number of classes a user can book.
Classes:
- Types: Classes can include yoga, gym, and dance etc etc.
- Capacity: Each class has a maximum number of attendees.
- Scheduling: Classes are scheduled at specific times, and multiple classes can run in a single day.
Booking:
- Users can book a class if it has not reached capacity.
- An admin can create, schedule, and cancel classes.
- Waitlisting: If a class is full, users can join a waitlist. When a booked user cancels, the first user on the waitlist is allocated the slot.
- Cancellation: Users can cancel their booking up to 30 minutes before the class starts. Admins can also cancel classes.
Methods: This is just to help you understand. Actual implementation may differ.
- User Management: Register/Login, Select Package
- Classes (Admin): Create a class, Schedule a class, Cancel a class
- Booking (User): Book a class, Cancel a class
Additional Considerations:
Evaluation Criteria:
Design:
- Use of object-oriented design principles (classes, interfaces, inheritance, polymorphism).
- Efficiency and scalability of data structures.
- Flexibility and modularity of system components.
- Consideration of security and data privacy principles.
Implementation:
- Functionality and accuracy of system features.
- Performance and resource optimization of algorithms.
- Code readability, maintainability, and adherence to coding standards.
- Error handling and exception management for smooth operation.
Expectations:
- Provide clean, professional-level code.
- Model core entities and relationships effectively.
- Demonstrate the solution with a method-based approach.
- Use memory-based object storage; a backend database is not required.
[execution time limit] 0.5 seconds (cpp)
[memory limit] 2g
In interview
was asked to implement a method such that user shouldn't be able to book a class it has already booked a class in same timeslot. (was given 5 mins for that)