Design a metro and bus ticket booking system
PremiumBackend systemMedium
- QR tickets
- Seat inventory
- Seat holds
Quick answer
This backend system interview question asks you to design a metro and bus ticket booking system. Aim for a design that meets its requirements at the stated scale, then explain its main components, data flow and trade-offs. Interviewers want to see how you scope the problem, size it and defend each choice.
The problem
Design a metro and bus ticket booking system for a city transit app. Riders buy metro QR tickets priced by distance and book seats on intercity buses. The hard part is that each mode needs its own booking flow: metro tickets have no seats but are checked at offline gates, while bus seats are shared stock sold by stop range.
For the metro, a rider picks two stations, pays and gets a QR ticket that gates scan on entry and again on exit. For buses, a rider picks a trip, a boarding stop, a drop stop and a seat, pays, and a conductor scans the ticket on board.
What must a metro and bus ticket booking system do?
- Metro QR tickets: Buy a single-journey ticket between two stations, priced by stations travelled, delivered as a signed QR code in the app.
- Bus seat booking: Search trips by route and date, see seats free for a stop range, hold one for 10 minutes while paying, then confirm.
How well must it do it?
- No double booking: Two riders never confirm the same bus seat for overlapping stop ranges, even when they pay at the same second.
- Gates never wait on the cloud: A gate decides in under 300 ms using only data already at the station.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- QR tickets
- Seat inventory
- Seat holds
- Offline validation
- Ed25519 signatures
- Payment webhooks
How you’ll practise
- Requirements
- Estimate
- API and data
- High-level design
- Deep dives
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any backend system design round.
- Clarifies the requirements before drawing anything
- Uses a few numbers that actually change the design
- Draws a clear path from the client to storage
- Picks storage and caching with reasons, not by habit
- Explains what breaks first under load and how to fix it
- States trade-offs openly instead of claiming a perfect design
Questions people ask about this interview question
- Which design type is this question?
- It is a backend system question. You design a metro and bus ticket booking system and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
- What should I cover first?
- Start with the requirements: what the system must do, how well it must do it and which numbers change the design. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team