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 4,451–4,475
Treat the boustrophedon-labeled board as a 1D graph of squares where from any square you can move 1–6 steps (dice roll), but landing on a…
Companies: Tesla
Array · Breadth-First Search · Matrix
Given a list of timestamped "snap" events (e.g., sender, receiver, time), compute metrics or answers about snap counts, unique recipients, response times, or bursty behavior…
General practice
Parse the linear equation with '+' and '-' to aggregate x-coefficients and constants on each side, then compute the net coefficient and constant to determine…
General practice
Given a sequence of questions you must consider in order, each question i either yields points[i] but forces you to skip the next brainpower[i] questions…
General practice
Sort the input array of integers by the absolute value of each element, returning the elements in non-decreasing order of |x|. Tie-breaking for equal absolute…
General practice
Reorder the array so integers with lower occurrence come first, and when frequencies tie place larger numbers before smaller ones. This is solved by counting…
General practice
Given an array containing some empty slots, find the minimum number of moves to sort the array when a move consists of taking any item…
General practice
Rearrange an even-length array that contains exactly half even and half odd numbers so that every even number occupies an even index and every odd…
General practice
Given an array and a function fn that maps each element to a unique numeric key, return the array sorted in ascending order by fn(element)…
General practice
Given a list of feature names and customer request texts, count how many requests mention each feature (case-insensitive, counting at most once per request and…
General practice
Sort an array of nonnegative integers by the number of 1s in their binary representation (ascending), using the numeric value as a tiebreaker (also ascending)…
General practice
Compute each integer's Collatz "power" (number of steps to reach 1 using x/2 for even and 3x+1 for odd), sort the numbers in [lo, hi]…
General practice
Order n items subject to precedence constraints while ensuring all items of the same group appear consecutively. The core challenge is to perform topological sorting…
General practice
General practice
Given an n×n matrix, reorder each diagonal independently by grouping elements along each top-left to bottom-right diagonal and sorting those that lie on or below…
General practice
Given a permutation mapping of decimal digits, compute each number’s "mapped value" by replacing every digit per mapping (ignoring leading zeros) and return nums sorted…
General practice
Given a list of countries with their gold, silver, and bronze medal counts, produce the Olympic leaderboard by sorting entries primarily by gold, then silver…
General practice
Given parallel arrays names and distinct heights, return the names reordered so people are sorted by descending height. Core challenge: associate each name with its…
General practice
Given a list of threat records with severity and exploitability metrics, rank them by primary key (severity) and secondary key (exploitability) according to the problem's…
General practice
Reorder only the vowels (a, e, i, o, u, case-sensitive) in the string into nondecreasing ASCII order while keeping all consonants fixed at their original…
General practice