Booking.com Coding Interview: Peak Concurrent Reservations

Based on a candidate's reported Booking.com interview

The interviewer opens

Hi, and thanks for joining. Welcome to your interview for the Senior Software Engineer role at Booking.com. We'll work through one coding problem together, and I'd like you to think out loud as you code. If you need to step out or take a break, the Pause button at the top right of your screen will pause the interview.

The problem is about finding the busiest moment for a property's reservations, and it's up in the Problem tab now. Please read it through and ask me any questions before you start.

The problem

A property wants to know the most reservations that are ever active at the same moment.

  • intervals: a list of [start, end] pairs (integers, start <= end), each a reservation's time span.

Each interval is closed, so it includes both endpoints: [1, 3] and [3, 5] are both active at time 3. Return the maximum number of intervals that contain a common point in time. Return 0 for an empty list.

Example: intervals = [[1,4],[2,5],[4,6],[7,8]] → 3

Sizes: up to 10^5 intervals.