Design a Long-Distance Bus/Coach Ticketing

Hard45 min
1 / 30
System design answer

Design a Long-Distance Bus/Coach Ticketing

Hard45 min30 sections
understanding•11 min read

Problem Statement: A Multi-Operator Seat Marketplace, Not a Simple Booking Form

Frames long-distance coach ticketing as an inventory-critical aggregator marketplace where seat correctness, not page speed, is the hard invariant.

Problem statement

Design a long-distance bus and coach ticketing platform that lets a traveler search schedules across many independent operators, see a live seat map, select one or more seats, possibly book only a partial segment of a longer route or stitch together a multi-leg journey, pay, receive a scannable ticket, and then track the bus and receive delay or route-change updates en route.

This is not a single-carrier reservation site. It is an aggregator marketplace. FlixBus publicly reports a partner model where FlixMobility runs the technology and sales platform while hundreds of partner companies operate the physical coaches; it reports hundreds of thousands of daily connections across dozens of countries. RedBus, owned by MakeMyTrip's ibibo group, aggregates thousands of private operators across India and Southeast Asia. Busbud and Wanderu aggregate thousands of carriers across hundreds of countries. The design problem therefore splits into two very different systems glued together: a high-fan-out, eventually consistent search and discovery layer, and a low-volume but correctness-critical seat reservation and ticketing layer.

Why the problem is distinctive

A seat on a coach is a perishable, exclusive, physically bounded resource. Unlike an e-commerce product with deep stock, a 54-seat coach has exactly 54 units, and seat 12A on the 08:30 departure can be sold exactly once. Two travelers clicking 'Book seat 12A' at the same millisecond must not both succeed. Worse, because the platform aggregates operators, the true source of seat truth may live in the operator's own reservation system, reached over an unreliable API. The platform must present an accurate seat map, hold seats while the user pays, and confirm the booking without ever double-selling, even when the operator's inventory API is slow, flaky, or eventually consistent.

On top of that, the brief requires partial-segment tickets. A coach running London to Edinburgh via Leeds and Newcastle carries riders who board and alight at different stops. Seat 12A can be sold London-to-Leeds to one rider and Leeds-to-Edinburgh to another. This turns seat availability from a single boolean into an interval-over-route-segments problem, which is the core algorithmic difficulty that shallow 'bus seat booking' answers miss.

Finally, the bus moves. Real-time GPS tracking, delay propagation, and route changes feed back into the product: a delayed bus shifts connection windows for multi-leg journeys, and a route change may invalidate a partial-segment ticket. The platform must reconcile a moving physical asset against durable booking state.

The four architectural planes

  1. Discovery plane: search, schedule aggregation, seat availability projection, ranking. Read-heavy, eventually consistent, cache-driven.
  2. Reservation plane: seat holds, booking, inventory decrement, payment, ticket issuance. Write-critical, strongly consistent per aggregate.
  3. Journey plane: multi-leg stitching, partial-segment availability, connection feasibility.
  4. Operations plane: live bus tracking, delay detection, disruption handling, operator and rider notification.

A strong answer keeps these planes separate. It lets search degrade to slightly stale seat counts without weakening the guarantee that a confirmed seat is never double-sold, and it lets the tracking layer be lossy without corrupting the booking ledger.

Public operating baseline versus design assumptions

Public figures establish that the category is real and large. FlixBus reports on the order of a hundred million passengers a year and hundreds of thousands of daily connections. RedBus reports tens of millions of tickets and extreme festival-season concurrency. These are cited company signals, not requirements for our fictional system. For capacity planning this answer assumes a mature multi-region platform and states every uncited number explicitly as an assumption.

Key Highlights

  • •A coach seat is an exclusive, perishable resource: the same seat on the same departure can be sold exactly once, which makes inventory correctness the top invariant.
  • •The platform is an aggregator marketplace, so the authoritative seat truth may live in a partner operator's reservation system behind an unreliable API.
  • •Partial-segment tickets turn seat availability into an interval-over-segments problem, not a single boolean.
  • •Four planes: discovery (search), reservation (booking), journey (multi-leg), and operations (tracking).
  • •Search may be eventually consistent, but a confirmed seat must never be double-sold.
  • •The moving bus feeds delay and route-change signals back into durable booking state.
Lead With the Seat Invariant
State in the first two minutes that a confirmed seat is never double-sold, even when the operator's inventory API is slow or flaky. That instantly separates a correctness-minded design from a generic CRUD booking app.
Do Not Treat Inventory as Deep Stock
An e-commerce mindset assumes replenishable stock. A coach has a fixed number of seats per departure; overselling is a hard product and legal failure, not a back-order.

Section Rescue Kit

Buzzwords to use:

Exclusive Perishable InventoryAggregator Marketplace

Safe statements:

  • "I will separate the read-heavy discovery plane from the correctness-critical reservation plane before choosing any database."
  • "The hard guarantee is that a confirmed seat is never double-sold; everything else may degrade."
Design a Long-Distance Bus/Coach Ticketing - System Design | WinJob | WinJob