Design a Ride-Sharing App like Uber — Concept Check
Questions on Design a Ride-Sharing App like Uber. Model a ride-sharing platform with driver matching, trip state machine, surge pricing strategy, and real-time status observer notifications.
Questions in this quiz
8 questions on Design a Ride-Sharing App like Uber — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A rider requests a trip and the system finds no available drivers. What happens next?
- AThe system automatically switches to surge pricing.
- BThe system cancels the request immediately.
- CThe system throws an exception and notifies the rider.
- DThe system queues the request until a driver becomes available.
2.During a trip, the status transitions from IN_PROGRESS to COMPLETED. What should occur?
- AThe system switches to normal pricing.
- BThe fare is calculated and both rider and driver are notified.
- CThe driver is automatically set to unavailable.
- DThe trip is canceled and no fare is calculated.
3.A driver updates their location but the system still matches them with distant riders. Why?
- AThe location update did not persist in the system.
- BThe driver's availability status is set to false.
- CThe system prioritizes driver ratings over proximity.
- DThe MatchingService is using outdated location data.
4.Which pattern is used to enforce trip status transitions in the Ride-Sharing App?
- AState pattern
- BObserver pattern
- CStrategy pattern
- DCommand pattern
5.A trip uses SurgePricing with a multiplier of 1.5. How is the fare calculated?
- ABase fare is multiplied by 1.5 after normal fare calculation.
- BSurgePricing only affects the base fare, not distance or duration.
- CBase fare is added to 1.5 times the distance and duration costs.
- DNormal fare calculation is skipped and only surge is applied.
6.What happens if a driver accepts a trip but does not start it?
- AThe trip automatically transitions to IN_PROGRESS after a timeout.
- BThe rider is notified and the trip is reassigned to another driver.
- CThe trip remains in ACCEPTED status until the driver starts it.
- DThe trip is canceled if not started within a specific duration.
7.How does the system notify a rider of a trip status change?
- ABy directly updating the rider's app interface.
- BThe rider is not notified of status changes.
- CThrough the Observer pattern implemented in TripStatusObserver.
- DVia a scheduled background task checking trip status.
8.What is the role of the MatchingService in the Ride-Sharing App?
- ATo notify drivers of trip status changes.
- BTo find the nearest available driver for a rider's request.
- CTo manage the lifecycle of a trip.
- DTo calculate trip fares based on distance and duration.