Airbnb logo

Airbnb Frontend Engineer System Design 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

No verified questions yet for Airbnb.

system design Senior api design #1

1. [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 #2

2. [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