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.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free