KatInterview

Reservation Notes Feature: Domain Model, Permissions, Bulk Edits

System DesignModel answer
MediumModel answerSystem Designobject-oriented-designaccess-controlaudit-log

Last updated

Design the object model and system for free-text notes on a reservation, with owner and admin edit rights, change auditing, and a safe path for bulk admin updates.

You are building a feature for a reservation platform (hotels, flights, or similar) that lets a booking carry a short free-text special note, such as "quiet room please" or "arriving late".

Requirements

  • Every reservation may have one special note.
  • The customer who owns a reservation can add, change, or clear the note on their own booking.
  • An administrator can change the note on any booking.
  • Administrators also need a bulk operation: apply a note change (for example, a policy notice) to a very large set of reservations, potentially thousands or more, in one action.

What to deliver

  1. An object-oriented model: the main classes or entities, their responsibilities, and where the permission rules live.
  2. A high-level system design: API surface, storage layout, and how components interact.
  3. A bulk update strategy that remains safe for the primary database and for users editing at the same time.

Decisions you should make explicit

  • Is the note a single field, or a list or history of entries?
  • Do you need to record who changed what and when?
  • What scale do you assume (reservation count, write rate, size of a bulk job)?

State your assumptions, justify them, and discuss trade-offs and failure cases.

Hints

Hint 1

Decide early whether you store one current value plus an append-only history, and what that buys you for audit and for concurrent edits.

Hint 2

Put the 'who may edit what' rule in one replaceable policy component rather than scattering role checks, and use a version number or ETag so simultaneous edits cannot silently overwrite each other.

Hint 3

For the bulk path, do not run one giant transaction: plan the target set, split it into chunks, process them asynchronously with idempotency and progress tracking, and think about dry-run, cancel, and revert.