Apple frontend engineer interviews emphasise JavaScript, DOM manipulation, CSS, accessibility, browser APIs, and UI component architecture.
No verified questions yet for Apple.
LRUCache to store song details, supporting efficient retrieval and updating.LRUCache with the following methods:get(key: string): string - Returns the value of the key if it exists, otherwise returns an empty string.put(key: string, value: string): void - Updates or adds a new key-value pair to the cache. If the cache exceeds its size, it should remove the least recently used item.Example 1:cache.put('1', 'Song A');cache.get('1'); // returns 'Song A'1 ≤ capacity ≤ 3000.Keys are guaranteed to be unique.DebouncedEventEmitter that has the following methods:on(event: string, listener: Function): void - Registers a listener for the specified event.emit(event: string, data: any): void - Emits an event, invoking listeners with the provided data after a debounce interval.setDebounceTime(ms: number): void - Sets a new debounce time.Example 1:new DebouncedEventEmitter().on('change', () => console.log('changed')).emit('change', { text: 'Hello' });No immediate output; 'changed' is logged after the debounce interval0 < ms ≤ 1000 for debounce time.1 ≤ event listener count ≤ 100.Router with the following methods:registerRoute(path: string, component: Function): void - Registers a new route with its corresponding component.navigate(path: string): void - Navigates to the given path and renders the associated component.Example 1:router.registerRoute('/home', HomeComponent); router.navigate('/home');HomeComponent is rendered on the screen.1 ≤ path length ≤ 100.1 ≤ component count ≤ 100.diff(oldTree: Node, newTree: Node): Array<Change> where Change is an object containing the type of change and the relevant node information.Example 1:diff(oldTree, newTree)[{ action: 'remove', node: oldNode }, { action: 'add', node: newNode }]1 ≤ |oldTree|, |newTree| ≤ 10^3Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free