Engineering Case Study

Designing a Real-Time Carpool Matching System

How drivers published multi-stop routes while passengers were intelligently matched, ranked, and coordinated through a real-time booking lifecycle.

16 min read·Published July 2026

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

Driver Creates Route
Route Published
Passenger Search
Geospatial Matching
Route Ranking
Booking Request
Driver Approval
Seat Reservation
Shared Carpool

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

Decision 01
Routes are matched, not drivers

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.

Decision 02
Ranking should consider more than distance

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.

Decision 03
Every booking progresses through a controlled lifecycle

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.