Airbnb logo

Airbnb Frontend Engineer Interview Questions

47 practice questions for Airbnb Frontend Engineer interviews

Airbnb frontend engineer interviews emphasise JavaScript, DOM manipulation, CSS, accessibility, browser APIs, and UI component architecture.

All Roles Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer
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 Medium Verified Question #3

3. Design A Queue


Category: Array coding problem
Design 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
coding Hard Verified Question #4

4. 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 #5

5. 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 Medium Verified Question #6

6. Best Way To Split Stay


Category: Graph coding problem
You 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
coding Medium Verified Question #7

7. Maximize Task Points


Category: Algorithm coding problem
You 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
coding Hard Verified Question #8

8. 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 Medium Verified 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
coding Hard Verified 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
coding Medium two pointers #1

1. [OA] Two Pointers — Implement a method to check if a string can form a palindrome at Airbnb's image upload feature.

In building features around user-generated content, checking the integrity of uploaded texts like captions is essential for a polished interface. We want to verify if users have uploaded a string that can be rearranged into a palindrome.
Problem Statement: Given a string s, determine if it can be rearranged to form a palindrome. Return true if it can, and false otherwise.
Example 1:
Input: s = "civic"
Output: true
Explanation: It can be rearranged to form a palindrome.
Example 2:
Input: s = "ivicc"
Output: true
Explanation: It can be rearranged to form a palindrome.
Constraints:
- 1 <= s.length <= 10^5
- s consists of only lowercase English letters.
coding Medium sliding window #2

2. [OA] Sliding Window — Implement a method to find the longest substring without repeating characters for Airbnb's messaging system.

In our messaging feature, we need to display user-friendly notifications by tracking the longest unique message sequence. This helps in showing the users their most recent unique messages efficiently.
Problem Statement: Given a string s, find the length of the longest substring without repeating characters. Return this length as an integer.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is abc, with the length of 3.
Example 2:
Input: s = "bbbbb"
Output: 1
Explanation: The answer is b, with the length of 1.
Constraints:
- 0 <= s.length <= 5 * 10^4
- s consists of English letters, digits, symbols, and spaces.
system design Senior api design #3

3. [OA] Design a virtual DOM differ for Airbnb's dynamic listing updates.

As Airbnb scales, updating UI components such as listing details needs an efficient way to manage changes without unnecessary re-renders. A virtual DOM implementation optimizes rendering by comparing the current DOM state with an updated virtual representation, allowing for specific changes to be applied.
Problem Statement: Define a VDOM class that managed a virtual reality tree and provided methods for creating, updating, and rendering real DOM elements based on a virtual representation.
### Class Definition:
- class VDOM:
- constructor() -> void:
Initializes a new Virtual DOM object.
- createElement(type: string, props: object, children: array) -> object:
Creates a virtual DOM node.
- diff(oldNode: object, newNode: object) -> object:
Compares two virtual nodes and returns the differences.
- render(node: object) -> HTMLElement:
Converts a virtual node into a real DOM element.
### Example 1:
Input:

const vdom = new VDOM();
const vnode = vdom.createElement('div', { id: 'app' }, [vdom.createElement('span', {}, ['Hello'])]);
vdom.render(vnode);

Output:
'<div id="app"><span>Hello</span></div>'
### Constraints:
- Element types should be strings, props should be an object, and children can be an array of virtual nodes or strings.
system design Senior api design #4

4. [OA] Design a client-side Router for Airbnb's web application.

The Airbnb web application requires a robust client-side routing architecture to seamlessly navigate between various views without requiring full page reloads. This will enhance the overall user experience, allowing smooth transitions and dynamic content loading.
Problem Statement: Define a Router class that implements the necessary methods for managing routes effectively. The Router needs to handle registration of routes and navigating to these routes while storing the current state.
### Class Definition:
- class Router:
- constructor() -> void:
Initializes a new Router object.
- register(path: string, callback: function) -> void:
Registers a new route with a corresponding callback function that is executed when the route is accessed.
- navigate(path: string) -> void:
Navigates to the given path, executing the associated callback.
- getCurrentRoute() -> string:
Returns the current path being displayed.
### Example 1:
Input:

const router = new Router();
router.register('/home', () => console.log('Home Page'));
router.register('/about', () => console.log('About Page'));
router.navigate('/home');

Output:
'Hrme Page'
### Constraints:
- The path should be a string representing the URL route.
- The callback function should be a valid JavaScript function.

Related Airbnb Frontend Engineer interview prep

Start practicing Airbnb questions

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

Get Started Free