← Booking Interview Insights

Booking·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Booking.com software engineer interview with a data-matching problem that sounds straightforward but has a few wrinkles worth thinking through ahead of time.

Questions Asked (2)

Q1

You have two unsorted lists, one of bookings and one of payments. Each payment record references a booking by ID. For each booking, figure out whether at least one payment exists for it. What does your output look like and how do you approach it?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The output format question tripped me up more than the logic itself.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the output format and constraints, then propose an efficient solution using a hash set of booking IDs from payments. Iterate through bookings to check membership, and discuss trade-offs like time/space complexity and potential optimizations for large datasets.

Pro tip: Mention that if the lists are huge, you might avoid loading all payment IDs into memory by sorting both lists and using a merge-like approach, but acknowledge the hash set is simpler and usually faster for in-memory data.

1. Clarify requirements and output

Ask if the output should be a list of booking IDs with a boolean, or just the bookings that have payments. Confirm if bookings without payments should be included.

2. Choose data structure

Propose using a hash set to store booking IDs from payments for O(1) lookups. Discuss alternatives like sorting and binary search or merge join.

3. Outline algorithm

Iterate through payments to build the set, then iterate through bookings to check membership and produce output. Mention handling duplicates and missing IDs.

4. Analyze complexity

State time complexity O(n + m) and space O(m) for the set, where n is bookings and m is payments. Compare with sorting approach O(n log n + m log m) time and O(1) extra space.

5. Discuss edge cases and scalability

Address empty lists, duplicate payments, payments referencing non-existent bookings, and memory constraints for large data. Suggest streaming or external sorting if needed.

Key Points to Mention

  • Hash set for O(1) lookup of payment booking IDs
  • Time and space complexity trade-offs between hash set and sorting
  • Handling duplicate payments and orphan payments
  • Output format: e.g., list of tuples (booking_id, has_payment) or filtered list
  • Scalability considerations for large datasets (memory vs. disk-based approaches)
  • Edge cases: empty lists, no payments, all bookings paid

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would your solution change if a single booking could have multiple payment records associated with it?

Algorithms & Data StructuresData Modeling
Author's notes

Didn't change much from my original approach since I was already using a set, so duplicates were handled implicitly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the current data model and assumptions, then systematically explore the impact on data structures, algorithms, and system design. Focus on how to handle one-to-many relationships, aggregation, and potential performance implications, while discussing trade-offs and scalability.

Pro tip: Emphasize that you would first confirm the business requirements and access patterns before jumping to a solution, as premature optimization or over-engineering can lead to unnecessary complexity. Also, mention that you would consider both read and write paths, as they often have different optimization strategies.

1. Clarify Requirements and Assumptions

Ask questions to understand the context: Are multiple payments partial or full? Can they be refunded? What are the query patterns (e.g., get total paid, list payments)? This ensures you address the right problem.

2. Revise Data Model

Change from a one-to-one to a one-to-many relationship. Introduce a separate Payment entity with a foreign key to Booking, or embed payments as a list if using a document store. Discuss normalization vs. denormalization.

3. Adjust Algorithms and Queries

Update operations like calculating total paid, checking payment status, or processing refunds to iterate over multiple payments. Consider aggregation functions (SUM, COUNT) and how to efficiently retrieve payments (e.g., pagination, indexing).

4. Address Performance and Scalability

Analyze the impact on database performance: indexing foreign keys, potential N+1 query problems, and caching strategies. Discuss how to handle large numbers of payments per booking.

5. Consider Consistency and Transactions

Ensure atomicity when updating booking status based on payments. Discuss transaction boundaries, locking, and idempotency for payment operations.

Key Points to Mention

  • One-to-many relationship and foreign key indexing
  • Aggregation queries (SUM, COUNT) and their performance
  • Potential N+1 query problem and mitigation (e.g., JOINs, batch loading)
  • Transaction management and consistency (e.g., ensuring booking is paid only when sum of payments >= total)
  • Scalability considerations: sharding, caching, and read/write separation
  • API design changes: endpoints to add/list payments, and backward compatibility

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.