Airbnb frontend engineer interviews emphasise JavaScript, DOM manipulation, CSS, accessibility, browser APIs, and UI component architecture.
No verified questions yet for Airbnb.
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:createElement(type: string, props: object, children: array) -> object:diff(oldNode: object, newNode: object) -> object:render(node: object) -> HTMLElement:
const vdom = new VDOM();
const vnode = vdom.createElement('div', { id: 'app' }, [vdom.createElement('span', {}, ['Hello'])]);
vdom.render(vnode);
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:register(path: string, callback: function) -> void:navigate(path: string) -> void:getCurrentRoute() -> string:
const router = new Router();
router.register('/home', () => console.log('Home Page'));
router.register('/about', () => console.log('About Page'));
router.navigate('/home');
path should be a string representing the URL route.callback function should be a valid JavaScript function.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free