Interview questions
Find a company or topic. Read the sources, then practice.
Loading the question library…
Find a company or topic. Read the sources, then practice.
Loading the question library…
Showing 2,076–2,100
Given an n×n grid of distinct values, implement a class that answers queries returning the sum of either orthogonally adjacent (top/left/right/bottom) or diagonal neighbors of…
General practice
Maintain three counters for big/medium/small parking slots and implement addCar(carType) to check the corresponding counter and decrement it if available, returning true on…
General practice
Companies: Rippling
Data Stream · Design · Hash Table · Queue
Companies: Optiver
Design · Hash Table
Implement a class that simulates a video-sharing platform with operations like uploading/deleting videos, watching/liking/commenting, subscribing/blocking users, and querying…
General practice
Find the residue class modulo space that contains the most elements of nums (since seeding with nums[i] destroys all numbers congruent to nums[i] mod space)…
General practice
Check whether a word's capitalization follows one of three valid patterns — all letters uppercase, all lowercase, or only the first letter uppercase — and…
General practice
Determine whether any connected region of identical letters in the m x n grid contains a cycle of length ≥4 formed by adjacent (up/down/left/right) moves…
General practice
Determine whether there exists a contiguous subarray (pattern) of length m that repeats at least k times consecutively (i.e., k non-overlapping adjacent repeats) within the…
General practice
Design a data structure that supports adding points (duplicates allowed) and, for a given query point, counts how many triples of stored points together with…
General practice
Given a chess coordinate like "a1", determine whether the square is white or black; the color is determined by the parity of the file (a–h)…
General practice
On an infinite grid with 8-directional (king) moves, decide if you can reach (fx,fy) from (sx,sy) in exactly t steps. The minimum required steps is…
General practice
Given a sequence of nonnegative integers, determine whether there exists a simple undirected graph (no self-loops or multi-edges) whose vertex degrees match the sequence —…
General practice
Split the even-length string into two equal halves and determine whether the two halves contain the same number of vowels (case-insensitive 'a', 'e', 'i', 'o'…
General practice
Given two inclusive time intervals on the same day in HH:MM format, determine whether they overlap (i.e., have any common moment). Because times are fixed-width…
General practice
Determine whether two strings can be made identical using arbitrary swaps of characters and global pairwise character relabelings; equivalently, check they have the same…
General practice
Choose n distinct positive integers with no two summing to k and minimize their total; the core challenge is to construct the smallest possible set…
General practice
Given two arrays of pins per turn, compute each player's score by summing turns where a turn's pins are doubled if either of the previous…
General practice
Check whether one n x n binary matrix can be made identical to another by rotating it 0, 90, 180, or 270 degrees — i.e.…
General practice
Given a string s of 'I' and 'D' of length n, construct any permutation of [0..n] such that perm[i] < perm[i+1] when s[i]=='I' and perm[i]…
General practice