Airbnb logo

Airbnb Hard Interview Questions

8 hard-level practice questions for Airbnb technical interviews

coding Hard Verified Question #1

1. Best Service For Rental Properties


Category: Graph coding problem
You are helping users find the most cost-effective way to get all the services they want for their rental property. You are given: - A list of...
Input: Graph (nodes and edges)
Output: Computed result
coding Hard Verified Question #2

2. Best Ski Route


Category: Graph coding problem
# Question You are skiing down from the top of a mountain and want to maximize your score when you reach the finish. There are multiple routes you...
Input: Graph (nodes and edges)
Output: Computed result
coding Hard Verified Question #3

3. Menu Order Equaling Target Sum


Category: Algorithm coding problem
You are given a menu containing prices of individual items. Given a target amount of money, find all possible combinations of menu items that...
Input: Integer(s)
Output: Integer
coding Hard Verified Question #4

4. Most Cost Effective Menu Order


Category: Dynamic programming coding problem
You are building an app that helps users determine the most cost-effective order they can place at a restaurant for the food items they want. You...
Input: List
Output: Computed result
coding Hard Verified Question #5

5. Collatz Sequence


Category: Algorithm coding problem
The Collatz conjecture is a famous unsolved problem in mathematics. For any positive integer n, the sequence is defined as follows: - If n is...
Input: Integer(s)
Output: Computed result
coding Hard Verified Question #6

6. Implement Refunds


Category: Algorithm coding problem
# Question AirBnB has a need to support refunds for our customers in case of booking changes or cancellations.
Input: List
Output: Array
coding Hard sliding window #1

1. [OA] Sliding Window — Implement search function for Airbnb rentals based on dates

Users often look for homes to rent on specific datetime ranges, and it's essential to efficiently check if the rental is available for the requested dates.
Problem statement: Given a list of rental_id with their corresponding availability ranges in the form of pairs (start_date, end_date) and a queried date range, return a list of rental IDs that are available during the entire period of the query.
- def search_available_rentals(rentals: List[Tuple[int, Tuple[int, int]]], query: Tuple[int, int]) -> List[int]: - Returns rental IDs that are available for the entire query date range.
Example 1:
Input: rentals = [(1, (1, 5)), (2, (2, 6)), (3, (5, 10))], query = (3, 4)
Output: [1, 3]
Explanation: Rentals 1 (1 to 5) and 3 (5 to 10) are available in the range of 3 to 4.
Example 2:
Input: rentals = [(1, (1, 5)), (2, (6, 10)), (3, (5, 10))], query = (2, 4)
Output: [1]
Explanation: Only Rental 1 is available during the queried dates.
Constraints:
- 1 <= rentals.length <= 10^4
- 1 <= rental_id <= 10^6
- 1 <= start_date < end_date <= 10^6
- 1 <= query[0] < query[1] <= 10^6
coding Hard graph #2

2. [OA] Graph Traversal — Implement a neighbor-finding feature for Airbnb properties

In a platform like Airbnb, it's crucial to find neighboring properties efficiently to help users browse similar options. This will enhance the user experience by showing related listings when a user views a particular property.
Problem statement: You need to implement a function that takes a list of properties represented as nodes in a graph and returns a list of all neighboring properties within a certain distance. Each node has a property_id and a list of neighbors (i.e., directly connected properties).
- def find_neighbors(properties: List[Property], id: int, distance: int) -> List[int]: - Returns the list of property identifiers of neighboring properties within the specified distance.
Example 1:
Input: properties = [[1, [2, 3]], [2, [1, 4]], [3, [1]], [4, [2]]], id = 1, distance = 1
Output: [2, 3]
Explanation: Property 1 is directly connected to properties 2 and 3.
Example 2:
Input: properties = [[1, [2, 3]], [2, [1, 4]], [3, [1]], [4, [2]]], id = 1, distance = 2
Output: [2, 3, 4]
Explanation: Property 1 is connected to properties 2 and 3 directly, and property 2 connects to property 4.
Constraints:
- 1 <= properties.length <= 1000
- 1 <= property_id <= 10^6
- 0 <= distance <= 50

Start practicing Airbnb questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free