Flipkart machine coding

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2024-10-24Added By Anonymous
Source: Link
Company: Flipkart
Role: unknown
Interview Stage: Machine Coding
Location: unknown
Year: unknown

Original Content:
Design a peer to peer delivery system Below are the expected features of the system. Problem Statement: 1. The system should be able to onboard new customers and drivers. 2. The list of items that can be delivered is preconfigured in the system and is fixed. 3. Customers should be able to place an order for the delivery of a parcel and also be able to cancel it. 4. One driver can pickup only one order at a time. 5. Orders should be auto-assigned to drivers based on availability. Even If no driver is available, the system should accept the order and assign it to a driver when the driver becomes free. The number of ongoing orders can exceed the number of drivers. 6. Once an order is assigned to a driver, the driver should be able to pick up the order and also mark the order as delivered after delivery. 7. If no driver picks up the order within 60 seconds of its creation, the order should be canceled. Regardless of whether an order has been assigned to a driver or not, if no driver picks it up within 60 seconds of order creation, the order should be canceled. 8. The system should be able to show the status of orders and drivers. 9. Notify the customer and drivers through email and phone for order updates. For this exercise, write a class that represents a vendor providing the email or SMS service and just print the log indicating that the vendor has processed the request 10. Canceled orders shouldn't be assigned to the driver. If an assigned order gets canceled the driver shouldn't be able to pick up the order, the driver should be available for other orders. 11. Once a driver picks up an order the order cannot be canceled by the user nor system. 12. Assume driver is available 24*7. Ignore the travel time. 13. Ensure application is thread safe and all concurrency scenarios.
Comments