ByteDance logo

ByteDance Frontend Engineer System Design Questions

33 practice questions for ByteDance Frontend Engineer interviews

ByteDance 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 ByteDance.

system design Senior api design #1

1. [System Design] Client-side Router — Design an Efficient Client-side Routing System for ByteDance

As ByteDance seeks to improve user experience in its single-page applications (SPAs), it requires a client-side router that efficiently handles navigation and resolves dynamic paths. Your task is to design a lightweight routing system capable of lazy loading components.
javascript
class ClientRouter {
addRoute(path: string, component: Function): void;
navigate(path: string): void;
getCurrentRoute(): string;
}

Example 1:
Input: router.addRoute('/home', HomeComponent); router.navigate('/home');
Output: Navigates to home and renders HomeComponent.
Constraints:
- The path should be unique for every route.
- Components can be asynchronously loaded.
system design Senior api design #2

2. [System Design] Virtual DOM — Design a Lightweight Virtual DOM for ByteDance

With ByteDance's applications needing lightweight component re-renders, you are tasked to design a lightweight Virtual DOM to optimize UI updates in high-frequency rendering scenarios.
javascript
class VirtualDOM {
createElement(type: string, props: object, ...children: any[]): VNode;
render(vnode: VNode, container: DOMNode): void;
update(oldVNode: VNode, newVNode: VNode): void;
}

Example 1:
Input: const vnode = virtualDOM.createElement('div', {id: 'container'}, 'Hello');
virtualDOM.render(vnode, document.getElementById('app'));

Output: Updates the DOM to show 'Hello' inside a div with an id 'container'.
Constraints:
- The props object can contain various properties, including event listeners.
- children can be a mix of strings and VNode objects.

Related ByteDance Frontend Engineer interview prep

Start practicing ByteDance questions

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

Get Started Free