Design trip booking REST API and schema
TuroSoftware Engineer · Technical ScreenLast updated
This question evaluates RESTful API design, temporal data modeling, inventory management strategies, request/response/status-code design, data schema and indexing, and handling booking lifecycle changes such as extensions.
Design a RESTful API for a guest to book a trip.
Include:
- Core endpoints (search availability, create booking, view/cancel booking, payment/confirmation if needed)
- Request/response shapes and key status codes
- Data model design and indexing
- Two inventory modeling approaches:
- "Per-date inventory" (store availability per day)
- "Range/interval-based inventory" (store availability as date ranges) Compare pros/cons.
Follow-up: Add support for extending an existing order/booking (e.g., extending checkout date). What changes are needed in the API and the data model?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.