Google frontend engineer interviews emphasise JavaScript, DOM manipulation, CSS, accessibility, browser APIs, and UI component architecture.
No verified questions yet for Google.
Router that manages routes for a map application and has the following methods:addRoute(path: string, component: any): void: Adds a new route mapping path to a component.navigate(path: string): void: Navigates to the specified path and loads the associated component.getCurrentComponent(): any: Returns the component of the current route.Example 1:path will always be a string in the format of /[a-zA-Z]+.component can be any function or class that should be rendered for that route.get(key: number): number: Retrieves the value of the key if the key exists in the cache. Otherwise, returns -1.put(key: number, value: number): void: Updates the value of the key if the key exists. If the key does not exist, add the key-value pair to the cache. If the cache reaches its capacity, it should invalidate the least recently used item before inserting the new item.Example 1:capacity of the cache is between 1 and 3000.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free