Preparing your design workspace

Loading the problem and your saved attempt…

Design a Ride-Hailing Class Model

Model a bounded ride request, driver offer, assignment, and trip journey with focused responsibilities and interfaces.

For this exercise, assume a rider requests a trip with pickup and destination, the service offers the request to one eligible available driver, and that driver may accept before the trip progresses through pickup, in-progress, completed, or cancelled states.

Keep the exercise at the class-design level: show responsibilities, relationships, key state, focused public methods, and one interaction walkthrough; do not implement code.

A rider and driver may each participate in at most one active assignment, only legal trip transitions may succeed, and no-driver, stale-offer, and invalid-transition outcomes must be explicit. Exclude pricing, payments, map routing, persistence, networking, live GPS, and production-scale dispatch.

Leave the driver-selection policy replaceable so a follow-up can introduce vehicle categories and simultaneous requests without redesigning the core journey.