← Booking.com Interview Insights

Booking.com·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Booking.com software engineering interview with a coding problem centered on payment reconciliation logic. The problem was more about data aggregation and edge case handling than raw algorithmic complexity, which I didn't fully expect going in.

Questions Asked (1)

Q1

Given a list of bookings (each with an ID and amount due) and a list of payments (each referencing a booking ID and a paid amount), aggregate all payments per booking and classify each booking as PAID, UNPAID, UNDERPAID, or OVERPAID based on how the total paid compares to the amount due. Return a mapping from booking ID to status.

Algorithms & Data StructuresData ModelingTechnical Trade-offs
Author's notes

My first instinct was to reach for a nested loop and I'm glad I caught myself before saying it out loud.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the input format and edge cases, then propose an efficient aggregation using a hash map to sum payments per booking. After computing totals, compare each booking's total paid against its amount due to assign the correct status, and finally discuss trade-offs like time/space complexity and handling of missing or invalid data.

Pro tip: Mention that you would handle floating-point precision carefully (e.g., using integers for cents or a tolerance) to avoid misclassification due to rounding errors. Also, proactively discuss how to handle bookings with no payments and payments referencing non-existent bookings.

1. Clarify requirements and edge cases

Ask about input types, expected output format, and how to handle edge cases like missing bookings, duplicate payments, zero amounts, and floating-point precision.

2. Design the aggregation algorithm

Propose using a hash map to accumulate total paid per booking ID by iterating through the payments list once. Discuss time and space complexity.

3. Classify each booking

Iterate through the bookings list, compute the difference between total paid and amount due, and assign status: PAID if equal, UNPAID if zero paid, UNDERPAID if less, OVERPAID if greater.

4. Handle edge cases and data integrity

Explain how to handle payments for unknown booking IDs, bookings with no payments, and precision issues (e.g., using integer cents or a tolerance).

5. Discuss trade-offs and optimizations

Talk about alternative approaches (e.g., sorting, database aggregation), memory usage, and whether to mutate inputs or return a new mapping.

Key Points to Mention

  • Use a hash map (dictionary) for O(1) average-time aggregation of payments per booking.
  • Time complexity: O(n + m) where n is number of bookings and m is number of payments; space complexity: O(n) for the result map.
  • Handle floating-point precision by using integer arithmetic (e.g., cents) or an epsilon tolerance for comparisons.
  • Define clear status rules: PAID (paid == due), UNPAID (paid == 0), UNDERPAID (0 < paid < due), OVERPAID (paid > due).
  • Consider data integrity: payments referencing non-existent bookings, duplicate booking IDs, and bookings with no payments.
  • Discuss whether to return a new mapping or modify the input, and how to handle missing or null values.

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