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,151–4,175
Given product and sales tables, compute per-product aggregate metrics (like total revenue or units sold) and return products that meet a comparison or ranking condition…
General practice
Given product and sales tables, write an SQL query that joins and aggregates sales per product to produce a summarized metric (e.g., total sales or…
General practice
Produce a list showing each product's price at every store by combining product and store records and matching them to the price table, returning NULL…
General practice
Given a list of invoice line items (product id, unit price and quantity), aggregate each product's total worth across all invoices by grouping by product…
General practice
Find products that had at least three orders in some year and also at least three orders in the immediately following year. This is typically…
General practice
Count how many subsets of crimes use at most n members while achieving total profit at least minProfit; this is a 0/1 knapsack-style counting problem…
General practice
Companies: Jane Street
Compute, for each project, the average experience_years of its assigned employees by joining the Project and Employee tables, grouping by project_id, and rounding the result…
General practice
Given a table of project–employee assignments, identify all pairs of employees who have worked together on at least two projects; this requires a self-join (or…
General practice
Given an n×n grid of tower heights, compute the total area of the top, front, and side projections (i.e., the "shadows" onto the xy, yz…
General practice
Given an array of functions that return Promises and a concurrency limit k, implement a scheduler that runs at most k promises simultaneously and starts…
General practice
Return a time-limited wrapper for an async function that invokes fn with given arguments and resolves with its result if it completes within t milliseconds…
General practice
Given n arrays, treat each array as a node and connect two nodes iff the number of distinct integers they share is at least k…
General practice
Count root-to-leaf paths in a binary tree of digits (1–9) that can be permuted into a palindrome — equivalently, paths whose digit counts have at…
General practice
Given a line of dominoes where some are initially pushed left (L), right (R), or upright (.), compute the final positions after simultaneous propagation of…
Companies: Anduril
Dynamic Programming · String · Two Pointers
Partition the array into k contiguous nonempty subarrays where each bag's cost is the sum of its endpoint weights, so the total score equals weights[0]+weights[n-1]…
Companies: Salesforce
Array · Greedy · Heap (Priority Queue) · Sorting
Given a bottom string and a list of allowed triples where each pair of adjacent blocks maps to one or more possible top blocks, determine…
General practice
Companies: IBM, PayPal
Breadth-First Search · Tree
Companies: Tesla
Given positions of multiple black queens and one white king on an 8x8 board, return the queens that can directly attack the king — i.e.…
General practice
Start with P = [1..m]; for each query value, report its current 0-based index in P and then move that value to the front, returning…
General practice
Given a set of 2D integer points and multiple circular queries, compute for each circle how many points lie inside or on it; the main…
Companies: Anduril
Array · Geometry · Math
Group rows by query_name and compute two aggregates: quality = average(rating/position) and poor_query_percentage = 100 * count(rating < 3) / total_count, with both values…
General practice
Given a sequence of queries with per-query costs and batch-level constraints (like max batch size, per-batch overhead, or dependency/ordering rules), partition the sequence…
General practice