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,276–4,300
Given two string arrays, message and bannedWords, determine whether message contains at least two words that exactly match any word in bannedWords (return true if…
General practice
Given a list of users and report events of the form (reporter -> post), deduplicate multiple reports by the same reporter, count reports per post…
General practice
Given a list of report events (reporter, postId), determine which posts receive at least k distinct reports and then compute for each reporter how many…
General practice
Given non-overlapping meetings within [0, eventTime], you may move at most one meeting (keeping its duration and staying inside the event, with no overlaps) to…
General practice
Given two DataFrames with the same schema, return a single table formed by stacking the rows of the second beneath the first (vertical concatenation /…
General practice
Reshape a table from wide to long by unpivoting the quarter_1–quarter_4 columns into rows so each record contains product, quarter, and sales. This is essentially…
General practice
Pivot the weather table so each row is a month and each distinct city becomes its own column containing that city's temperature for that month…
General practice
Given an m×n matrix, return a new r×c matrix containing the same elements in row-major order if r*c equals m*n; otherwise return the original matrix.
General practice
Given a transactions table with at least one record per day, compute for each date the seven-day moving average of the daily total paid (current…
General practice
Given a permutation order of race finishers and a sorted subset friends, return the friends arranged by their positions in order — i.e., filter the…
General practice
Count the number of ways to split a digit string s (no leading zeros) into integers in [1, k], returning the count modulo 1e9+7. This…
General practice
Given unordered adjacent pairs from an array with unique elements, reconstruct the original array by treating values as nodes in a graph and the pairs…
General practice
Repeatedly delete the leftmost adjacent pair of letters that are consecutive in the alphabet (treating 'a' and 'z' as consecutive) until no such pairs remain…
General practice
Return the number of arguments passed to a function — essentially count the variadic parameters. The input is provided as a JSON array representing the…
General practice
Given a deck of unique integers, find an ordering such that repeatedly revealing the top card and moving the next top card to the bottom…
General practice
Reverse the order of bits in a 32-bit unsigned integer and return the resulting integer (treat the input as exactly 32 bits). For repeated calls…
General practice
Compute the sum over all characters of (1-indexed string position) × (reversed alphabet value where 'a' = 26, 'b' = 25, ..., 'z' = 1)…
General practice
Given a perfect binary tree, reverse the node values at every odd-numbered level (1, 3, 5, ...) so that the sequence of values on each…
General practice
Reverse the order of alphabetic characters in a string while keeping all non-letter characters fixed in their original positions. This is typically solved with a…
General practice