Katkat

Design trip booking REST API and schema

TuroSoftware Engineer · Technical Screen

Last 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:
  1. "Per-date inventory" (store availability per day)
  2. "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?