← 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 looked straightforward at first but the edge cases are where it gets interesting.

Questions Asked (1)

Q1

Given a list of bookings (each with an id and an amount due) and a list of payments (each referencing a booking id and a paid amount), compute the total payments per booking and classify each booking as PAID, UNPAID, UNDERPAID, or OVERPAID. Return a mapping from booking id to status.

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

My first instinct was to nest loops and I caught myself before writing it out, which felt like a small win.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the input and output formats, edge cases, and assumptions (e.g., can payments reference non-existent bookings? Are amounts integers or floats?). Then, outline an algorithm that aggregates payments per booking using a hash map, and finally compares the total paid against the amount due to assign statuses.

Pro tip: Mention that you would handle floating-point precision by using integer cents or a tolerance threshold, and discuss how to scale the solution for large datasets (e.g., streaming aggregation or distributed processing).

1. Clarify requirements and edge cases

Ask about input types, possible missing bookings, negative payments, and whether overpayment is allowed. Confirm the expected output format (e.g., mapping from booking ID to status).

2. Design the aggregation approach

Propose using a hash map to accumulate total payments per booking ID. Iterate through payments once, summing amounts for each booking.

3. Compare and classify

For each booking, compare the total paid to the amount due. Use conditional logic to assign PAID, UNPAID, UNDERPAID, or OVERPAID, handling floating-point precision carefully.

4. Analyze complexity and trade-offs

Discuss time and space complexity (O(n + m) time, O(n) space). Mention alternative approaches (e.g., sorting, database joins) and their trade-offs.

5. Test and validate

Walk through edge cases: no payments, exact payment, partial payment, overpayment, payments for unknown bookings. Suggest unit tests to verify correctness.

Key Points to Mention

  • Use a hash map (dictionary) to aggregate payments per booking ID for O(1) average lookup.
  • Handle floating-point precision by converting to integer cents or using a tolerance (e.g., 1e-9).
  • Define behavior for payments referencing non-existent bookings (ignore, error, or log).
  • Consider scalability: streaming aggregation if data is too large for memory, or distributed processing (e.g., MapReduce).
  • Discuss time and space complexity: O(n + m) time, O(n) space, where n is number of bookings and m is number of payments.
  • Mention potential database implementation: SQL GROUP BY with SUM and CASE for status classification.

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