Booking.com

Online Assessment

Booking.comOnline Assessment

Company-style OA practice sets with full problem statements, sample test cases, and solutions.

5 Sets2 Questions/Set90 minHash TableMathStringArraySorting

💰 Contribute & Earn

Have you recently taken Booking.com's Online Assessment or coding test? Share the questions, test cases, or assessment patterns you encountered. Earn SWE180 Coins for every verified submission and use them to unlock other company OA sets and premium tools for free!

Share OA & Earn Coins ➔

Practice Sets

Booking.com Software Engineer Online Assessment — 2026

2 questions
Q1.
Support Escalation Triple Review Total
TreesBinary TreeLowest Common AncestorBinary Lifting
Hard

Problem Statement

Customer support at Booking.com is organised as a strict reporting tree. The head of support sits at the top, and every other team member reports to exactly one person directly above them, while each person has at most two direct reports. Every team member also has a team code, a number that the quality assurance team likes to record.

Occasionally, a quality review picks three support cases handled by three different team members at once, and wants to know the single person lowest in the hierarchy who still sits on the reporting chain above every one of the three, so that one reviewer can oversee all three cases together. A team member counts as being on their own reporting chain, so if one of the three is the manager of the others, that manager is the review point. This shared reviewer is the natural escalation point that all three cases could reach by following the reporting chain upward.

You are given the layout of the whole support organisation, the team code of every member, and a long list of review requests where each request names three team members. For every request, find the review point for those three members and add together the team codes found at every review point across every request into one grand total that the quality team can record.

Implement the function sumOfTripleMeetingBadges(int n, vector<vector<long long>> nodes, int q, vector<vector<long long>> queries), which returns a long long.

Input Format

  • n: the number of team members.
  • nodes: the organisation layout and team code of every member (the exact column layout was not visible in the OA screenshot; the example below assumes nodes[i] = [manager of i, team code of i], with manager = -1 for the head).
  • q: the number of review requests.
  • queries: q rows, each naming three team members [a, b, c].

Output Format

  • A single long long: the sum of the team codes of the review point (lowest common manager) of every request.

Constraints

  • Each member has at most two direct reports (binary tree).
  • Exact bounds on n and q were not visible in the OA screenshot; q is described as a long list, so each request must be answered in about O(log n).

Sample Test Cases

Example 1

Input

n = 5
nodes = [[-1, 10], [0, 20], [0, 30], [1, 40], [1, 50]]
q = 2
queries = [[3, 4, 2], [3, 4, 1]]

Output

30

Explanation

Illustrative example (input layout assumed; the OA's own sample was not visible).

Member 0 is the head; 1 and 2 report to 0; 3 and 4 report to 1.

Request (3, 4, 2): LCA(3, 4) = 1, LCA(1, 2) = 0 → team code 10.

Request (3, 4, 1): LCA(3, 4) = 1, and 1 is on its own chain → team code 20.

Total = 10 + 20 = 30.

Time:O((n + q) log n)
Space:O(n log n)
Approach:The review point of three members is their lowest common ancestor, and LCA(a, b, c) = LCA(LCA(a, b), c). Build depths and a binary-lifting table with one BFS from the head, answer each request with two LCA queries, and add the team code of the result to a long long total.
Q2.
Dinner Rush Demand Tracker
HashingOrdered SetMultisetSimulation
Medium

Problem Statement

The live operations desk at OpenTable, a Booking Holdings company, watches a busy Friday evening unfold one event at a time. Every minute exactly one thing happens: either a diner makes a reservation at some restaurant, or a diner cancels a reservation at some restaurant. Every restaurant in the city is identified by a numeric code so the monitoring software can process the whole evening automatically.

The desk defines the demand pressure at any minute as the combined count of active reservations at the two restaurants currently holding the most active reservations at that exact moment. When only one restaurant currently has any active reservations, the pressure is that lone count by itself, and when no restaurant has any active reservations at all, the pressure is zero.

At the end of the evening, the desk wants one number, the total demand pressure, which is simply the sum of the demand pressure recorded right after each of the n minutes. You must write a function that replays the whole evening from the event log and reports this total demand pressure.

It is guaranteed that the log never asks to cancel a reservation at a restaurant whose current count of active reservations is zero.

Implement the function sumTopTwoStockPressure(int n, vector<vector<int>> actions), which returns a long long.

Input Format

  • n: the number of minutes (events).
  • actions: n rows, one event per minute (the exact column layout was not visible in the OA screenshot; the example below assumes [type, restaurant], with type 1 = reserve and type 2 = cancel).

Output Format

  • A single long long: the sum of the demand pressure recorded after each minute.

Constraints

  • A cancel never targets a restaurant with zero active reservations.
  • Exact bounds on n and restaurant codes were not visible in the OA screenshot; plan for an O(n log n) solution.

Sample Test Cases

Example 1

Input

n = 6
actions = [[1, 5], [1, 7], [1, 5], [2, 5], [1, 9], [2, 7]]

Output

12

Explanation

Illustrative example (input layout assumed; the OA's own sample was not visible).

Minute 1: {5:1} → 1. Minute 2: {5:1, 7:1} → 2. Minute 3: {5:2, 7:1} → 3.

Minute 4: {5:1, 7:1} → 2. Minute 5: {5:1, 7:1, 9:1} → 2. Minute 6: {5:1, 9:1} → 2.

Total = 1 + 2 + 3 + 2 + 2 + 2 = 12.

Time:O(n log n)
Space:O(n)
Approach:Keep a hash map from restaurant to its active count, and a multiset holding every positive count. On each event, erase the restaurant's old count from the multiset (if positive), update it, and insert the new count (if positive). The pressure is the sum of the largest one or two elements of the multiset; add it to a long long total.

Comprehensive Booking.com Online Assessment Patterns & Questions

Gain complete transparency into the Booking.com online assessment process. Prepare effectively with real, verified coding challenges, test patterns, and platform details.

Booking.com Exact Coding Questions

Wondering what top companies are actually asking in their initial screening rounds? We provide exact Data Structures, Algorithms, and logical reasoning questions reported by candidates who recently took the Booking.com online tests. Stop guessing and start practicing the right problems.

Test Patterns & Platforms

Understand exactly how many questions to expect, the typical time limits, and the platforms used (e.g., HackerRank, Codility, CodeSignal). Knowing the format in advance is the first step to clearing the Booking.com OA.

🔥 Why practice these assessments?

  • ✓High ROI: Most candidates are filtered out at the OA stage. Passing the OA guarantees an interview.
  • ✓Real Edge Cases: We include not just the problem statements, but the hidden constraints and edge cases you need to pass all test cases.
  • ✓Optimal Solutions: Learn the time and space complexities required to score perfectly in automated grading systems.