Katkat

Match Bookings to Payments

Booking.comSoftware Engineer · Onsite

Last updated

This question evaluates skill in matching records across unsorted collections, focusing on data structures, aggregation and handling one-to-one and one-to-many relationships between bookings and payments.

You are given two unsorted lists:

  • bookings: each record contains at least a unique booking_id
  • payments: each record contains at least a booking_id indicating which booking the payment belongs to

For each booking, determine whether a payment has been made for that booking.

Clarify your expected output, for example:

  • return a boolean for a single booking, or
  • return a mapping/list showing whether each booking has at least one matching payment

Follow-up:

  • How would your approach change if one booking can have multiple payment records?