Overview
Traditional ride-hailing connects one passenger with one driver.
Carpooling is fundamentally different.
Drivers publish routes containing multiple stops, passengers request seats for only part of that journey, and the platform must determine whether both parties are actually compatible before a booking can be created.
Unlike a normal ride request, several passengers can join the same route while progressing through different stages of the booking lifecycle.
The challenge wasn't simply matching passengers to nearby drivers.
It was coordinating an entire shared journey in real time.
The Problem
Finding nearby carpools is only the beginning.
The platform needed to answer several questions before allowing a passenger to join.
- Is the pickup point close to one of the driver's planned stops?
- Does the route continue beyond the passenger's destination?
- Are seats still available?
- Is the driver currently accepting passengers?
- Which available route provides the best overall experience?
At the same time, multiple passengers could attempt to reserve the last remaining seat simultaneously.
The system had to remain consistent while still providing a responsive real-time experience.
Architecture
The platform separates route discovery, passenger ranking, booking, and ride execution into independent stages.
Each stage validates its own assumptions before allowing the booking to progress further.
Engineering Decisions
Drivers publish complete routes rather than responding to individual ride requests.
Passengers are matched against those routes, allowing multiple bookings to coexist while preserving a predictable journey for the driver.
The closest route isn't always the best one.
Each candidate route receives a weighted relevance score based on proximity, driver rating, remaining seats, and departure timing before results are presented to the passenger.
This produces recommendations that better reflect the overall travel experience.
Passengers don't immediately join the shared ride.
Bookings move through distinct stages including request, approval, pickup, payment, and completion, allowing every participant to remain synchronized throughout the journey.
Challenges
Unlike traditional ride-hailing, a single carpool can contain several passengers at different stages.
One passenger may still be waiting for approval while another has already boarded.
A third passenger may have completed payment but hasn't yet reached their destination.
The platform also needs to synchronize drivers, passengers, booking rooms, payment status, seat availability, and route progress in real time without allowing one passenger's actions to affect another's booking.
Managing those independent lifecycles while presenting a single shared ride required careful separation between booking state and route state.
Outcome
The resulting system allows drivers to publish reusable routes while passengers discover and join them through intelligent ranking rather than simple proximity.
Each booking progresses independently, seat availability remains consistent under concurrent activity, and all participants transition into a shared real-time journey once the ride begins.
The result is a flexible marketplace that supports shared transportation without sacrificing consistency or user experience.
Related Engineering Notes
Building a Weighted Carpool Ranking Engine
Finding nearby carpools is only half the problem. Delivering the right one first requires combining multiple business signals into a single relevance score.
Preventing Seat Overbooking with Distributed Locks
When multiple passengers attempt to book the last available seat simultaneously, correctness matters more than speed. This article explores the concurrency strategy behind preventing overbooking.