Chaturmind
LearnDSASystem DesignInterview PrepDevOpsEngineering GrowthBlog
Start learning
Chaturmind

Structured learning paths for engineers who want to go deep. Written by practitioners.

Learn

  • Java
  • DSA
  • System Design
  • Spring Boot
  • AI / ML
  • DevOps
  • Engineering Growth
  • Java Interview Prep

Company

  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Chaturmind. All rights reserved.

Built for engineers who want to go deep.


← Java Interview Prep: 8+ Years (Senior & Lead)

Expert Core Java

  • Tricky Java Output, Operators & OOP Edge Cases — Interview Questions
  • Tricky Exceptions, Memory & Keyword Questions — Interview Questions
  • Classic Java Language Questions, Senior-Grade Answers — Interview Questions
  • Classic Collections, Threads & JDK APIs, Senior-Grade Answers — Interview Questions
  • Reflection, Dynamic Proxies, final & Modern OOP Design — Interview Questions

JVM Internals & Performance

  • Class Loading, Bytecode & Object Layout — Interview Questions
  • JIT Compilation & Runtime Optimisations — Interview Questions
  • Garbage Collectors Deep Dive — Interview Questions
  • JVM Tuning, GC Logs & Memory Footprint — Interview Questions
  • Memory Leaks, OutOfMemoryErrors & Profiling Tools — Interview Questions
  • Modules, Agents & Advanced JVM APIs — Interview Questions

Collections & Concurrency at Scale

  • Collections Internals & Complexity — Interview Questions
  • Iterators, Comparators & Ordering Contracts — Interview Questions
  • Concurrent Collections, Queues & Lock-Free Structures — Interview Questions
  • Threads, Executors & ForkJoin Internals — Interview Questions
  • Locks, Atomics, CAS & Synchronizers — Interview Questions
  • Java Memory Model, volatile, Fences & ThreadLocal — Interview Questions
  • Deadlock, Livelock, Starvation & Concurrent Design — Interview Questions
  • CompletableFuture, Parallel Streams & Non-Blocking I/O — Interview Questions

Modern Java (8 to 21+)

  • Lambdas & Functional Interfaces Internals — Interview Questions
  • Streams & Collectors Deep Dive — Interview Questions
  • Optional & Interface Default/Static Methods — Interview Questions
  • Java 9–25 Features & Virtual Threads — Interview Questions

Design Patterns, SOLID & Clean Code

  • Design Pattern Trade-offs & Combinations — Interview Questions
  • SOLID, Clean Code & Anti-Patterns — Interview Questions

Spring & Spring Boot Internals

  • IoC, Dependency Injection & Bean Lifecycle Internals — Interview Questions
  • Spring AOP, Proxies & @Async Internals — Interview Questions
  • Spring Configuration, Auto-Configuration & Custom Starters — Interview Questions
  • Spring MVC & REST Internals, Exception Frameworks — Interview Questions
  • Spring Security Advanced Internals — Interview Questions
  • Spring WebFlux, Reactor & R2DBC — Interview Questions
  • Spring Cloud, Observability & Distributed Tracing — Interview Questions
  • Spring Boot 3, Native Images & Production Scenarios — Interview Questions

JPA, Hibernate & Databases at Scale

  • Spring Data JPA — Queries, Projections, Custom Repositories & Locking — Interview Questions
  • JPA Entity Mapping, Associations & Cascades — Interview Questions
  • JPQL vs Native Queries in Depth — Interview Questions
  • Hibernate Caching — First-Level, Second-Level & Query Cache — Interview Questions
  • Lazy vs Eager Loading, LazyInitializationException & N+1 — Interview Questions
  • JPA Transactions, Propagation, Isolation & Dirty Checking — Interview Questions
  • SQL vs NoSQL, Indexing & Query Tuning — Interview Questions
  • Database Scaling, Replication, Pooling & Consistency Models — Interview Questions
  • Redis, Search, Time-Series, CDC & Transactional Data Modelling — Interview Questions

Testing Strategy & API Design

  • Spring Boot Test Slices, Context & Test Strategy — Interview Questions
  • Testing Web, Persistence, Security, Async & Messaging in Spring Boot — Interview Questions
  • JUnit 5 & Mockito, Advanced — Interview Questions
  • MockMvc, WebTestClient & Testcontainers in Depth — Interview Questions
  • REST Principles, Status Codes & Resource Design — Interview Questions
  • OpenAPI, Validation Errors, API Versioning & GraphQL — Interview Questions

Build, DevOps & Cloud

  • Maven & Gradle at Scale — Interview Questions
  • Git, CI/CD Pipelines & Release Safety — Interview Questions
  • Docker & Kubernetes for Java Engineers — Interview Questions
  • Quality Gates, Artifact Repositories & Secrets Management — Interview Questions
  • AWS Deployment & Scaling for Spring Boot — Interview Questions
  • Multi-Cloud Deployment, High Availability, Cost & Cloud Troubleshooting — Interview Questions

Kafka & Messaging

  • Kafka Internals & Delivery Semantics — Interview Questions
  • Spring Kafka — Error Handling, DLQs, Schemas & Operations — Interview Questions
  • RabbitMQ, JMS & Messaging Models — Interview Questions

Microservices & Architecture

  • Distributed Systems Fundamentals — CAP, Consistency, Availability & SLOs — Interview Questions
  • DDD, Hexagonal Architecture & Service Boundaries — Interview Questions
  • Event-Driven Architecture, CQRS, Event Sourcing, Sharding & Idempotency — Interview Questions
  • Rate Limiting, Resilience, Caching at Scale & Chaos Engineering — Interview Questions
  • Files, Documents & Internationalisation in Java Backends — Interview Questions
  • WebSockets, Schedulers, Notifications & Real-Time Pipelines — Interview Questions

System Design Scenarios

  • Booking Systems, CRS, Inventory & Concurrency Control — Interview Questions
  • Dynamic Pricing & Rule Engines — Interview Questions
  • Partner Integrations — OTA Sync, Retries, Webhooks, Reconciliation & Bulk Data — Interview Questions
  • Designing Caches & Rate Limiters — Interview Questions
  • Event-Driven Architecture, Kafka at Scale, IoT & Real-Time Pipelines — Interview Questions
  • Observability, Logging, Alerting & Audit Systems — Interview Questions
  • Multi-Tenant SaaS, Identity & Platform Services — Interview Questions
  • Search, Notifications, Chat, Fraud Detection & Workflows — Interview Questions
  • Extreme Scale, 99.99% Availability, DR & Project Deep-Dive Stories — Interview Questions

Security for Senior Engineers

  • Tokens, OAuth2 PKCE, Web Attacks & API Security — Interview Questions
  • TLS, mTLS, Zero Trust, Secrets, DDoS & Privacy Compliance — Interview Questions

Leadership & Behavioural

  • Leadership Style, Motivation & Team Health — Interview Questions
  • Delivery, Planning & Decisions Under Uncertainty — Interview Questions
  • Problem Solving, Growth & Career Stories — Interview Questions
  • Stakeholder Communication, Ethics & Compliance — Interview Questions
  • Mentoring, Knowledge Sharing & Code Reviews — Interview Questions
  • Agile & Scrum Practices for Senior Engineers — Interview Questions
  • Architecture Decision-Making — Interview Questions
  • Conflict Resolution & Difficult Conversations — Interview Questions
Chaturmind
← Java Interview Prep: 8+ Years (Senior & Lead)

Expert Core Java

  • Tricky Java Output, Operators & OOP Edge Cases — Interview Questions
  • Tricky Exceptions, Memory & Keyword Questions — Interview Questions
  • Classic Java Language Questions, Senior-Grade Answers — Interview Questions
  • Classic Collections, Threads & JDK APIs, Senior-Grade Answers — Interview Questions
  • Reflection, Dynamic Proxies, final & Modern OOP Design — Interview Questions

JVM Internals & Performance

  • Class Loading, Bytecode & Object Layout — Interview Questions
  • JIT Compilation & Runtime Optimisations — Interview Questions
  • Garbage Collectors Deep Dive — Interview Questions
  • JVM Tuning, GC Logs & Memory Footprint — Interview Questions
  • Memory Leaks, OutOfMemoryErrors & Profiling Tools — Interview Questions
  • Modules, Agents & Advanced JVM APIs — Interview Questions

Collections & Concurrency at Scale

  • Collections Internals & Complexity — Interview Questions
  • Iterators, Comparators & Ordering Contracts — Interview Questions
  • Concurrent Collections, Queues & Lock-Free Structures — Interview Questions
  • Threads, Executors & ForkJoin Internals — Interview Questions
  • Locks, Atomics, CAS & Synchronizers — Interview Questions
  • Java Memory Model, volatile, Fences & ThreadLocal — Interview Questions
  • Deadlock, Livelock, Starvation & Concurrent Design — Interview Questions
  • CompletableFuture, Parallel Streams & Non-Blocking I/O — Interview Questions

Modern Java (8 to 21+)

  • Lambdas & Functional Interfaces Internals — Interview Questions
  • Streams & Collectors Deep Dive — Interview Questions
  • Optional & Interface Default/Static Methods — Interview Questions
  • Java 9–25 Features & Virtual Threads — Interview Questions

Design Patterns, SOLID & Clean Code

  • Design Pattern Trade-offs & Combinations — Interview Questions
  • SOLID, Clean Code & Anti-Patterns — Interview Questions

Spring & Spring Boot Internals

  • IoC, Dependency Injection & Bean Lifecycle Internals — Interview Questions
  • Spring AOP, Proxies & @Async Internals — Interview Questions
  • Spring Configuration, Auto-Configuration & Custom Starters — Interview Questions
  • Spring MVC & REST Internals, Exception Frameworks — Interview Questions
  • Spring Security Advanced Internals — Interview Questions
  • Spring WebFlux, Reactor & R2DBC — Interview Questions
  • Spring Cloud, Observability & Distributed Tracing — Interview Questions
  • Spring Boot 3, Native Images & Production Scenarios — Interview Questions

JPA, Hibernate & Databases at Scale

  • Spring Data JPA — Queries, Projections, Custom Repositories & Locking — Interview Questions
  • JPA Entity Mapping, Associations & Cascades — Interview Questions
  • JPQL vs Native Queries in Depth — Interview Questions
  • Hibernate Caching — First-Level, Second-Level & Query Cache — Interview Questions
  • Lazy vs Eager Loading, LazyInitializationException & N+1 — Interview Questions
  • JPA Transactions, Propagation, Isolation & Dirty Checking — Interview Questions
  • SQL vs NoSQL, Indexing & Query Tuning — Interview Questions
  • Database Scaling, Replication, Pooling & Consistency Models — Interview Questions
  • Redis, Search, Time-Series, CDC & Transactional Data Modelling — Interview Questions

Testing Strategy & API Design

  • Spring Boot Test Slices, Context & Test Strategy — Interview Questions
  • Testing Web, Persistence, Security, Async & Messaging in Spring Boot — Interview Questions
  • JUnit 5 & Mockito, Advanced — Interview Questions
  • MockMvc, WebTestClient & Testcontainers in Depth — Interview Questions
  • REST Principles, Status Codes & Resource Design — Interview Questions
  • OpenAPI, Validation Errors, API Versioning & GraphQL — Interview Questions

Build, DevOps & Cloud

  • Maven & Gradle at Scale — Interview Questions
  • Git, CI/CD Pipelines & Release Safety — Interview Questions
  • Docker & Kubernetes for Java Engineers — Interview Questions
  • Quality Gates, Artifact Repositories & Secrets Management — Interview Questions
  • AWS Deployment & Scaling for Spring Boot — Interview Questions
  • Multi-Cloud Deployment, High Availability, Cost & Cloud Troubleshooting — Interview Questions

Kafka & Messaging

  • Kafka Internals & Delivery Semantics — Interview Questions
  • Spring Kafka — Error Handling, DLQs, Schemas & Operations — Interview Questions
  • RabbitMQ, JMS & Messaging Models — Interview Questions

Microservices & Architecture

  • Distributed Systems Fundamentals — CAP, Consistency, Availability & SLOs — Interview Questions
  • DDD, Hexagonal Architecture & Service Boundaries — Interview Questions
  • Event-Driven Architecture, CQRS, Event Sourcing, Sharding & Idempotency — Interview Questions
  • Rate Limiting, Resilience, Caching at Scale & Chaos Engineering — Interview Questions
  • Files, Documents & Internationalisation in Java Backends — Interview Questions
  • WebSockets, Schedulers, Notifications & Real-Time Pipelines — Interview Questions

System Design Scenarios

  • Booking Systems, CRS, Inventory & Concurrency Control — Interview Questions
  • Dynamic Pricing & Rule Engines — Interview Questions
  • Partner Integrations — OTA Sync, Retries, Webhooks, Reconciliation & Bulk Data — Interview Questions
  • Designing Caches & Rate Limiters — Interview Questions
  • Event-Driven Architecture, Kafka at Scale, IoT & Real-Time Pipelines — Interview Questions
  • Observability, Logging, Alerting & Audit Systems — Interview Questions
  • Multi-Tenant SaaS, Identity & Platform Services — Interview Questions
  • Search, Notifications, Chat, Fraud Detection & Workflows — Interview Questions
  • Extreme Scale, 99.99% Availability, DR & Project Deep-Dive Stories — Interview Questions

Security for Senior Engineers

  • Tokens, OAuth2 PKCE, Web Attacks & API Security — Interview Questions
  • TLS, mTLS, Zero Trust, Secrets, DDoS & Privacy Compliance — Interview Questions

Leadership & Behavioural

  • Leadership Style, Motivation & Team Health — Interview Questions
  • Delivery, Planning & Decisions Under Uncertainty — Interview Questions
  • Problem Solving, Growth & Career Stories — Interview Questions
  • Stakeholder Communication, Ethics & Compliance — Interview Questions
  • Mentoring, Knowledge Sharing & Code Reviews — Interview Questions
  • Agile & Scrum Practices for Senior Engineers — Interview Questions
  • Architecture Decision-Making — Interview Questions
  • Conflict Resolution & Difficult Conversations — Interview Questions
HomeLearnJava Interview PrepJava Interview Prep: 8+ Years (Senior & Lead)System Design Scenarios
✓ FreeAdvanced· 10 min read

Booking Systems, CRS, Inventory & Concurrency Control — Interview Questions

End-to-end design of a hotel Central Reservation System (CRS) — the booking flow, avoiding double booking, inventory allocation and reservation holds, booking concurrency control (optimistic, pessimistic, conditional updates), distributed locks and a lock service, and scaling to 10k TPS and a million bookings a day — with data models, SQL and Java sketches.

Published September 25, 2026


How to use this lesson

These questions come from hospitality and travel interviews (CRS, OTAs, pricing, channel managers), but the patterns apply to any booking domain: flights, tickets, e-commerce stock.

Answer with the design framework:

  1. requirements and numbers;
  2. APIs;
  3. data model;
  4. the high-level components;
  5. the hard part (concurrency and consistency);
  6. scaling;
  7. failure handling.

The hard part is almost always "don't sell the same room twice, while staying fast".

Learn it in depth → The 6-Step Design Framework

Q1. How does a booking flow work end to end? How would you design a hotel booking (reservation) system?

Short answer: The typical flow:

  1. Search: the guest searches by dates, location and guests. The availability and rate are read from a cache or search index (fast, eventually consistent).
  2. Select and price: get the exact rate for the room type, rate plan and dates, including taxes and fees. Return a price quote with a short expiry.
  3. Hold (reserve): create a temporary hold on the inventory (for example, 10–15 minutes), atomically decrementing the availability for each night. This is strongly consistent, in the inventory database.
  4. Payment: authorise the card, or take a deposit, through the payment service (with an idempotency key).
  5. Confirm: turn the hold into a confirmed reservation, generate a confirmation number, and emit a BookingConfirmed event (through the outbox).
  6. Downstream (asynchronous): confirmation email or SMS, sync to OTAs and channel managers (updated availability), the property management system (PMS), analytics, loyalty.
  7. Expiry: a scheduler releases expired holds (payment not completed), and restores the inventory.
  8. Modify or cancel: releases or adjusts the inventory, applies the cancellation policy, refunds, and emits events.
Client → API Gateway → Booking Service ──► Inventory Service (DB, source of truth)
                          │                 ▲
                          ├──► Pricing Service (cache)
                          ├──► Payment Service (idempotent)
                          └──► Outbox → Kafka → Notifications / OTA sync / PMS / Analytics
Search Service ← (CDC / events) ← Inventory + Rates   (read model, eventually consistent)

Key points to cover:

  • Separate the read path (search: massive volume, cached, eventual) from the write path (booking: small volume, strongly consistent).
  • Idempotency on booking and payment (clients retry).
  • A saga across inventory, payment and confirmation, with compensation (release the hold and void the payment on failure).

Learn it in depth → Hotel Reservation System

Q2. How do you avoid double booking? How do you design booking concurrency control?

Short answer: Make the inventory decrement atomic and conditional, in the database that is the source of truth. Don't use "check then update" in application code.

Option 1: a conditional update (the simplest, and very effective). The inventory is counted per room type per night:

-- room_inventory(hotel_id, room_type_id, stay_date, total, sold, held, version)
UPDATE room_inventory
   SET held = held + :qty
 WHERE hotel_id = :h AND room_type_id = :rt
   AND stay_date BETWEEN :checkIn AND :lastNight
   AND total - sold - held >= :qty;
-- success only if updated rows == number of nights (all in one transaction)

If the row count is less than the number of nights, roll back: at least one night is sold out.

Option 2: optimistic locking (a @Version column): read the row, check it, then update WHERE version = ?. Retry on conflict. Good when contention is low to moderate.

Option 3: pessimistic locking (SELECT … FOR UPDATE, in JPA @Lock(PESSIMISTIC_WRITE)): lock the inventory rows in a consistent order (by date) to avoid deadlocks. Good for high contention on a few rows (a popular hotel on New Year's Eve), but keep the transactions very short.

Option 4: specific rooms (seat-style inventory): assign physical rooms with a unique constraint (room_id, stay_date) in a room_night table. The database rejects the duplicate insert.

Also important:

  • Idempotency keys on the booking API, so a client retry doesn't create two bookings.
  • Holds with expiry during payment.
  • Overbooking policies are sometimes deliberate (hotels overbook by a small percentage, based on no-show forecasts). Make it a configured allowance, not a race condition.
@Transactional
public Hold hold(HoldRequest r) {
    int nights = r.nights();
    int updated = inventoryRepo.incrementHeld(r.hotelId(), r.roomTypeId(),
                                              r.checkIn(), r.checkOut().minusDays(1), r.qty());
    if (updated != nights) throw new SoldOutException();   // rolls back the whole transaction
    return holdRepo.save(Hold.of(r, Instant.now().plus(Duration.ofMinutes(15))));
}

Common trap: a distributed lock (Redis) alone is not a safe way to prevent double booking. Locks can expire during GC pauses or network delays, so two holders can act at once. The database constraint or conditional update must still be the final guard. Use locks only to reduce contention, or with fencing tokens.

Q3. How do you design hotel inventory allocation, and an inventory reservation system?

Short answer:

  • The model: inventory per hotel × room type × night (total, sold, held, out of order), plus allocations per channel when needed (for example, 5 rooms reserved for a tour operator, or a shared pool for OTAs, the brand website and the call centre). Most modern systems use a single shared pool (a "last room available" policy) to avoid unsold channel allocations.
  • Stop-sell and restrictions: closed dates, minimum or maximum length of stay, closed to arrival or departure. These are checked during availability and booking.
  • Reservation lifecycle: HELD → CONFIRMED → CHECKED_IN → CHECKED_OUT or CANCELLED / EXPIRED / NO_SHOW, with each transition updating held and sold atomically.
  • Hold expiry: a delayed job (a scheduled query for expired holds using FOR UPDATE SKIP LOCKED, or delayed messages) releases them.
  • Group blocks: allocate a block with a release date, after which the unused rooms return to the general pool.
  • Events (InventoryChanged) feed the channel manager / OTA sync and the search cache.
  • Audit every inventory change (who, what, when, and why), which you need for disputes and reconciliation.

Q4. How do you implement a distributed lock? How would you design a distributed lock service?

Short answer:

  • Use one when a single actor must perform a task across many instances (a scheduled job, a cache rebuild, a per-resource critical section that isn't in one database).
  • The options:
    • database-based locks: a lock table with a unique key and an expiry, SELECT … FOR UPDATE, or PostgreSQL advisory locks. Simple and consistent;
    • Redis: SET lock:key <token> NX PX 30000, with release by a Lua script that checks the token. Fast, but only as reliable as your Redis setup; Redisson adds watchdog renewal;
    • ZooKeeper or etcd: consensus-backed, with ephemeral nodes or leases, and a monotonic revision usable as a fencing token. The most correct choice for critical coordination;
    • libraries: ShedLock (scheduled jobs), and Spring Integration LockRegistry.
  • Design requirements for a lock service:
    • mutual exclusion;
    • leases with a TTL (so a crashed holder doesn't block forever), plus renewal (heartbeats);
    • fencing tokens: an incrementing number the resource checks, rejecting writes from a stale holder;
    • high availability through consensus (Raft, as in etcd);
    • reentrancy and fairness, if needed;
    • metrics (wait time, holders).
// Redis lock with owner token (conceptual)
String token = UUID.randomUUID().toString();
Boolean ok = redis.opsForValue().setIfAbsent("lock:hotel:42", token, Duration.ofSeconds(30));
if (Boolean.TRUE.equals(ok)) {
    try { doWork(); }
    finally { redis.execute(UNLOCK_IF_OWNER_LUA, List.of("lock:hotel:42"), token); }
}

Common trap: the Redlock algorithm (multi-node Redis locking) is debated. It relies on timing assumptions, and without fencing tokens a paused client can still act after its lease expired. For correctness-critical work, prefer consensus systems (etcd, ZooKeeper) with fencing, or database constraints.

Learn it in depth → Design a Leader Election Algorithm

Q5. How would you design, or redesign, a scalable CRS? How do you design a hotel CRS for 10k TPS?

Short answer:

  1. Clarify the load profile: CRS traffic is read-heavy. There can be 100–1000 availability and rate reads (look-to-book) for each booking. So 10k TPS is mostly shopping, and perhaps 50–200 bookings per second at peak.
  2. Split by domain:
    • Search & availability (a read model);
    • Rates & pricing;
    • Inventory (the write model, source of truth);
    • Booking / reservation;
    • Payment;
    • Distribution (OTA, GDS and channel connectivity);
    • Notifications;
    • Property / content.
  3. The read path at scale:
    • precomputed availability and rate caches (Redis, or an in-memory grid), keyed by hotel:roomType:date;
    • Elasticsearch/OpenSearch for geographic and attribute search;
    • a CDN for static content;
    • these caches are updated by events (CDC from inventory and rates).
  4. The write path:
    • inventory in a relational database (PostgreSQL or MySQL), sharded by hotel_id (bookings for one hotel stay on one shard, so the conditional updates remain local transactions);
    • short transactions;
    • outbox events.
  5. Resilience:
    • timeouts, circuit breakers and bulkheads around slow partners;
    • rate limiting of OTA and partner traffic;
    • an asynchronous OTA sync;
    • multi-AZ deployment.
  6. Observability: latency SLOs per API, booking funnel metrics, and reconciliation jobs (inventory vs bookings, CRS vs OTA).

For a redesign of a legacy CRS: use the strangler-fig pattern: start by extracting the read path (search) behind an API gateway, then rates, then inventory and booking, with dual-writes or CDC and reconciliation during the migration.

Learn it in depth → Back-of-Envelope Estimation

Q6. How would you scale a system to a million bookings a day? How do you design a high-traffic booking system?

Short answer:

  • Do the maths: 1 million bookings a day ≈ 12 per second on average. With a peak factor of 10–20×, that's about 120–250 writes per second. That's modest for a well-designed sharded relational setup. The reads (shopping) are the real scale: perhaps 100× more.
  • Techniques:
    • stateless services, autoscaled horizontally;
    • cache the reads aggressively (availability, rates, content), with event-driven invalidation;
    • shard the inventory and bookings by hotel (or by region); read replicas for reporting;
    • asynchronous processing of everything not needed for the confirmation (emails, OTA sync, analytics) through Kafka;
    • idempotent APIs and consumers;
    • queue-based load levelling for flash sales: admit users through a virtual waiting room or token bucket;
    • hot-key protection (a popular hotel): pessimistic row locks on a small set of rows, or pre-splitting inventory into buckets;
    • connection pool sizing, database tuning, batching;
    • load testing at 2–3× the expected peak.

Q7. Follow-up: how do you handle a booking when payment succeeds but the confirmation step fails?

Short answer: Use a saga with idempotent steps and compensation:

  • the booking stays in a PAYMENT_AUTHORISED state;
  • the confirmation is retried (idempotently) by a recovery job or consumer;
  • if it can't be completed (the hold expired and the room was sold), compensate by voiding or refunding the payment, and notifying the guest.

Reconciliation jobs compare the payment provider records with bookings daily. Never leave money and inventory out of sync silently.

Follow-up questions this topic invites — and their answers

Q: Why count inventory per night instead of per stay? A: Stays overlap in arbitrary ways; per-night counters make availability a simple minimum over the nights, and the booking an atomic decrement of each night.

Q: How long should a hold last? A: Long enough to complete payment (typically 10–15 minutes), short enough not to block real sales. Tune it from funnel data, and release holds promptly on abandonment.

Q: What's a fencing token? A: A monotonically increasing number issued with each lock grant. The protected resource remembers the highest token it has seen and rejects requests with a lower one, so a stale lock holder (after a GC pause) can't corrupt data.

Q: Why use SKIP LOCKED for expiry jobs? A: Several job instances can each claim different expired holds without blocking each other or processing the same row twice.

Previous

WebSockets, Schedulers, Notifications & Real-Time Pipelines — Interview Questions

Next

Dynamic Pricing & Rule Engines — Interview Questions

AI Tutor

Lesson: Booking Systems, CRS, Inventory & Concurrency Control — Interview Questions

Quick actions

AI responses can be inaccurate. Verify critical information.