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,001–2,025
Implement a curry utility that transforms a function of N arguments into a sequence of nested functions supporting partial application until all required arguments are…
General practice
Design a data structure that maintains a dynamic set of intervals (possibly with associated weights) supporting updates like add/remove/modify and answering range queries such…
General practice
Given a list/table of customer orders, compute how many orders each customer placed and return the required output (e.g., customers with frequency above a threshold…
General practice
Aggregate orders by customer_number to count each customer's orders and return the customer(s) with the maximum count; the problem guarantees a unique top customer, while…
General practice
Given a set of transaction logs, group and time-order purchases per customer to detect patterns like frequent items/sequences, repeat-purchase intervals, or top-K trends; the…
General practice
Given Visits and Transactions tables, identify customers who had visits with no matching transaction records and return each customer_id with the count of such no-transaction…
Companies: Bloomberg
Database
Find customers whose purchased product set includes every product listed in the Product table. The challenge is to test set containment across relations — e.g.…
General practice
Given purchase/transaction records, find customers who have bought both product A and product B at least once but never purchased product C; this is a…
General practice
Given Customers and Orders tables, return the names of customers who never placed an order — i.e., customers with no matching customerId in Orders. This…
General practice
Given transaction records (customer_id, transaction_date), determine which customer(s) have the largest number of transactions occurring within any sequence of consecutive…
General practice
Given a list of timestamped purchase records, identify customers whose per-period purchase totals form a strictly increasing sequence across consecutive time windows; this…
General practice
Given an m x n grid with impassable cells (0), empty cells (1), and trees (>1) with distinct heights, find the minimum number of 4-directional…
General practice
Given a complete binary tree labeled 1..2^n-1, each query adds an edge between nodes a and b and asks for the length of the unique…
General practice
Treat the m x n matrix as concentric layers (rings) and cyclically rotate each layer counterclockwise by k steps, returning the transformed matrix. Note m…
General practice
Companies: Bloomberg
Array · Matrix · Simulation
Group rows by date_id and make_name and, accounting for possible duplicate records, report for each group the number of distinct lead_id values and the number…
General practice
For each day in an array of daily temperatures, determine how many days you must wait until a warmer temperature appears (or 0 if none)…
Companies: Anduril, Chime, Goldman Sachs
Array · Monotonic Stack · Stack
Given an unsorted list of dates (or date intervals), produce a compact list of inclusive date ranges by merging consecutive or overlapping days. Requires correct…
General practice
Parse the YYYY-MM-DD string and compute the ordinal day by summing days in the preceding months and adding the day-of-month, handling leap years (year divisible…
General practice
Return a debounced wrapper for a given function that delays execution by t milliseconds and cancels any pending invocation if the wrapper is called again…
General practice
Reverse a slanted transposition cipher: encodedText is produced by reading a rows×cols matrix row-by-row after originalText was placed along top-left-to-bottom-right diagonals…
General practice
Count the number of ways to decode a string of digits and '*' (where '*' can be any digit '1'–'9') into letters using single- and…
General practice
Given encoded where encoded[i] = arr[i] XOR arr[i+1] and the first element arr[0] = first, reconstruct the original array by iteratively using XOR to recover…
General practice
Reconstruct the unique permutation perm of 1..n (n odd) given adjacent XORs encoded[i] = perm[i] ⊕ perm[i+1]; use XOR properties (overall XOR of 1..n and…
General practice