47 practice questions for Airbnb Mobile Engineer interviews
Airbnb mobile engineer interviews focus on iOS or Android platform knowledge, memory management, offline-first architecture, and mobile-specific system design.
Category: Graph coding problemYou 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
codingHardVerified 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
codingMediumVerified Question#3
3. Design A Queue
Category: Array coding problemDesign a queue data structure that mimics memory allocation patterns. The queue must store elements in fixed-size blocks (arrays), where each...Input: Array Output: Computed result
codingHardVerified Question#4
4. Menu Order Equaling Target Sum
Category: Algorithm coding problemYou 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
codingHardVerified Question#5
5. Most Cost Effective Menu Order
Category: Dynamic programming coding problemYou 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
codingMediumVerified Question#6
6. Best Way To Split Stay
Category: Graph coding problemYou are building a property recommendation system for vacation rentals. Given a list of available properties, you need to find the optimal...Input: Graph (nodes and edges) Output: Integer
codingMediumVerified Question#7
7. Maximize Task Points
Category: Algorithm coding problemYou are given a set of tasks, each with a deadline and a reward (profit) for completing it. Each task takes exactly one day to complete, and only...Input: Given input Output: Computed result
codingHardVerified Question#8
8. Collatz Sequence
Category: Algorithm coding problemThe 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
codingMediumVerified Question#9
9. Shortest Maze Path
Category: Grid/matrix coding problem# Question You are in a maze that is represented as a grid of cells, where each cell is either empty (O) or blocked (X). You can move up, down,...Input: 2D grid Output:** Integer
codingHardVerified Question#10
10. 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
codingHarddynamic programming#1
1. [OA] Dynamic Programming — Minimize battery usage on commute
Airbnb app users require efficient battery management to prolong device usage while navigating to their destinations. Optimizing battery usage according to user preferences during their commute is essential. Use dynamic programming to determine the minimal battery usage when users must traverse a series of n locations with associated batteryCosts that represent the battery consumption to move from one location to the next. Function signature: - int minBatteryUsage(int[] batteryCosts): - Returns the minimum battery usage to navigate through all locations.Example 1: Input: batteryCosts = [5, 10, 3, 8] Output: 18 Explanation: In this case, the minimum battery usage is calculated as the sum of the smallest transitions: 5 + 3 + 10 = 18. Constraints: - batteryCosts.length <= 10^5 - batteryCosts[i] within [1, 100].
codingHardtwo pointers#2
2. [OA] Two Pointers — Merge multiple user location streams
Airbnb handles several user location streams simultaneously to provide accurate search results based on proximity. Merging these streams efficiently is crucial for performance. Given an array of locationStreams representing UserLocation objects containing longitude, latitude, and timestamp, merge these streams into one sorted array based on timestamp. UserLocation class: - class UserLocation: - float longitude: longitude of the user. - float latitude: latitude of the user. - int timestamp: the timestamp when the location was recorded.Example 1: Input: locations = [[UserLocation(-73.9857, 40.7484, 3), UserLocation(-73.9860, 40.7488, 2)], [UserLocation(-73.9856, 40.7481, 4)]] Output: [UserLocation(-73.9860, 40.7488, 2), UserLocation(-73.9857, 40.7484, 3), UserLocation(-73.9856, 40.7481, 4)] Explanation: The merged list is sorted by timestamp. Constraints: - locations.length <= 10^4 - locations[i].length <= 10^3 - longitude, latitude within [-180, 180]. - timestamp within [0, 10^9].
system designSenioroffline sync#3
3. Design an Offline-first Synchronization Engine
Airbnb users often find themselves in areas with poor connectivity. Designing an offline-first synchronization engine ensures that user data is consistently synced and available, regardless of network conditions. ### Class: OfflineSyncEngine - void saveData(String key, String value): - Saves data locally when offline and queues it for synchronization. - void syncData(): - Syncs queued data with the server once connectivity is regained. - String getData(String key): - Retrieves the requested data from local storage.### Example 1: Input: OfflineSyncEngine syncEngine = new OfflineSyncEngine() syncEngine.saveData("booking_12345", "Booking details...") syncEngine.syncData() when restored connectivity after going offline. Output: Data should be persistently stored and synced with the server.### Constraints: - Each user may have up to 10,000 data entries. - Sync operations should not exceed time limits of 2 seconds ideally, post connectivity restoration.
system designSeniormessaging#4
4. Design a Notification Manager for Airbnb
In Airbnb’s mobile application, users must receive real-time notifications about bookings, cancellations, messages, and promotions. Designing a robust notification system that seamlessly delivers these messages to users at scale is vital.### Class: NotificationManager - void sendNotification(User user, String message): - Sends a notification message to the specified user. - List<Notification> getUserNotifications(User user): - Returns a list of notifications for the specified user. - void markAsRead(Notification notification): - Marks the specified notification as read. - List<Notification> getUnreadNotifications(User user): - Retrieves all unread notifications for the specified user.### Example 1: Input: User user = new User(1, "Alice") NotificationManager nm = new NotificationManager() nm.sendNotification(user, "Your booking is confirmed!") Output: nm.getUserNotifications(user) returns List<Notification> containing the confirmation message.### Constraints: - Users and notifications are uniquely identifiable. - Each user can have up to 1,000 notifications.