Google frontend engineer interviews emphasise JavaScript, DOM manipulation, CSS, accessibility, browser APIs, and UI component architecture.
Question Given a string where letters are sorted in alphabetical order, identify all letters that appear more than twice and record their first and...
Input: ArrayQuestion You are tracking GPS location errors by comparing measured GPS locations against a set of "golden" (reference) locations. Each location...
Input: ListQuestion Design a data structure to maintain a dynamic set of points on a 2D coordinate plane. Support operations to insert points, remove points,...
Input: ListQuestion Given a singly linked list, reverse the second half of the list and then interleave the nodes from the first half and the reversed second...
Input: Linked listQuestion You are given a range [A, B] and a sequence of painting operations. For each operation [L, R], calculate the total length of unpainted...
Input: Array of intervalsQuestion You are given a set of test cases and a black-box function runTests() that accepts a subset of these test cases and returns whether...
Question You are given an M x N garden grid and a list of crops, each requiring a specific number of plots. The total number of plots required by...
Input: 2D gridQuestion You are given an array A of integers. A triplet is a sequence of three consecutive elements. A triplet is called zero-sum if the...
Question A player is playing a game in which coins are placed on and removed from a table. The game consists of multiple rounds. At the beginning...
Input: Stringtext and a dictionary array where each element is in the format "<key>:<id>". Here key is a token string and id...Input: ArrayStreamBuffer class that buffers a stream of integer latency samples in FIFO order and supports O(1) access to both the minimum and maximum...Input: Integer(s)Question Design a PathRouter class that maps URL-like path patterns to handler names. Patterns may contain wildcard segments (*) that match any...
Question Given a string, build a Frequency Merge Tree as follows: 1. Count the frequency of each character in the string. 2. Create a leaf node...
Input: String+ and -, and parentheses ( and ), simplify...Input: Stringm x n binary grid where each cell is either '1' (land) or '0' (water). A group of connected land cells (connected horizontally...Input: 2D gridviews1 and views2 representing the number of times two different albums have been viewed, implement a function maxUniqueViews(views1: number[], views2: number[]): number to return the maximum unique views a user can get by sharing the albums from both lists.views1 = [1, 3, 5], views2 = [2, 4, 6]61 + 2 + 3. The unique views = 1, 3, 2, 4, 5, 6.views1 = [1, 2, 3], views2 = [3, 4, 5]53 counts only once. The unique views = 1, 2, 4, 5.Constraints:1 <= views1.length, views2.length <= 10^51 <= views1[i], views2[j] <= 10^9ads representing the timestamps of ads being displayed, and an integer minGap representing the minimum time gap required between the same ad displays, write a function maxAdsDisplayed(ads: number[], minGap: number): number that returns the maximum number of ads that can be displayed following this rule.ads = [1, 2, 3, 4, 5, 6], minGap = 24ads = [1, 1, 1, 3, 5], minGap = 231 <= ads.length <= 10^51 <= ads[i] <= 10^91 <= minGap <= 10^6Router 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.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.capacity of the cache is between 1 and 3000.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free