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 1,676–1,700
Given a list of values (e.g., scores) and one or more targets, compute the rank expressed as a percentage of the population—i.e., the proportion of…
General practice
Companies: Amazon, Google, Meta, Microsoft
Math
Companies: Amazon, Bloomberg, Google
Math · Prefix Sum · String
Given two strings for a person's name and profession, return a single concatenated, properly formatted string combining them according to the specified pattern (e.g., "name…
General practice
Given nums and k, find the lexicographically smallest permutation of nums whose concatenated decimal representation is divisible by k (or return [] if none). The…
General practice
Given an integer array nums, produce ans by concatenating nums with itself so that ans has length 2n and ans[i]=nums[i], ans[i+n]=nums[i] for 0<=i<n; this is…
Companies: Bloomberg, Google
Array · Simulation
Return the decimal value (mod 1e9+7) of the binary string formed by concatenating the binary representations of 1..n. The core challenge is to do this…
General practice
Compute each user's confirmation rate by aggregating the Confirmations table (confirmed_count / total_count) for every user in Signups, treating users with no confirmations as…
General practice
Check whether a given positive integer becomes a different valid number when rotated 180 degrees — using digit mappings 0→0,1→1,6→9,8→8,9→6 (digits 2,3,4,5,7 are invalid)…
General practice
Count how many integers in [1, N] consist only of digits {0,1,6,8,9} and whose 180° rotation (mapping 0→0,1→1,6↔9,8→8) produces a different valid number. The common…
General practice
Given an array representing seat availability (e.g., 0 = available, 1 = occupied) and an integer k, determine whether there exists a contiguous block of…
General practice
Given an ordered Logs table (id is autoincrement), identify all num values that appear in at least three consecutive rows by id and return those…
Companies: Meta
Database
Given a time-ordered list of transaction amounts, find the longest contiguous run (or count of runs) where each amount is strictly greater than the previous—possibly…
General practice
Find the maximum-sum non-empty subsequence of nums such that consecutive chosen indices differ by at most k. This is a DP problem where dp[i] =…
General practice
Given an undirected graph that is guaranteed to be isomorphic to a 2D grid, reconstruct a 2D arrangement placing each node exactly once so that…
General practice
Reconstruct a binary search tree given its preorder traversal (all values unique) by using the BST ordering together with the preorder sequence to determine which…
General practice
Reconstruct the unique binary tree from given inorder and postorder traversal arrays by using the last element of postorder as the root and partitioning the…
General practice
Determine whether the characters of s can be partitioned into k non-empty palindromic strings using all letters. This reduces to a frequency/parity check: it's possible…
General practice
Given an n×m grid, produce p where p[i][j] is the product of all grid elements except grid[i][j], taken modulo 12345. With up to 1e5 elements…
General practice
Given a pattern of 'I' (increasing) and 'D' (decreasing) of length n, produce the lexicographically smallest string of distinct digits 1..9 of length n+1 whose…
General practice
Given a binary tree root, produce a string from a preorder traversal where each node is its value followed by its children in parentheses; omit…
General practice
Given a target string and a list of words with costs, repeatedly append any word to an initially empty string (paying its cost) to exactly…
General practice