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 926–950
Given a binary matrix where 1 represents land and 0 represents water, find any valid path from the top-left corner (0,0) to the bottom-right corner…
Companies: Meta
Last reported Oct 2025
Count how many ordered sequences (elements may be reused) of distinct positive integers from nums sum to target — order matters so different permutations are…
Companies: Meta
Last reported Oct 2025
Given two strings, find the longest substring (contiguous or by character multiset) that appears as an anagram in both strings — i.e., both strings contain…
Companies: Navan
Last reported Oct 2025
Companies: OpenAI
Last reported Oct 2025
Count how many ways a given n (1 ≤ n ≤ 10^9) can be written as a sum of consecutive positive integers. The core challenge…
Companies: Meta, Microsoft
Enumeration · Math
Last reported Oct 2025
Given a binary tree with integer node values, calculate path sums where odd-valued nodes trigger alternate node summation and even-valued nodes sum all nodes to…
Companies: Oracle
Last reported Oct 2025
Companies: Anthropic
Arrays & Strings · Grids & Matrices
Last reported Oct 2025
Given a sorted array of lowercase letters and a target letter, return the smallest character strictly greater than the target, or wrap around to the…
Companies: Meta
Last reported Oct 2025
Given a calendar represented as a string of working days (W) and holidays (H), and a limited number of PTO days, find the maximum consecutive…
Companies: Meta
Last reported Oct 2025
Companies: OpenAI
Experiment Analysis & Readout
Last reported Oct 2025
Implement a function to evaluate nested mathematical expressions represented as function calls, such as "add(1, mul(2, sub(6,8)))".
Companies: Google
Last reported Oct 2025
Given a BST, update each node's value to be its original value plus the sum of all greater node values, performing the transformation in-place. The…
Companies: Microsoft
Last reported Oct 2025
Complete the code to process a list of Thing objects by grouping them by type and timestamp, sending each to the appropriate service, and handling…
Companies: Sailpoint
Last reported Oct 2025
Find the length of the longest substring that can be turned into all the same letter by performing at most k character replacements; this is…
Companies: D. E. Shaw, Goldman Sachs, Meta, Microsoft +1
Hash Table · Sliding Window · String
Last reported Oct 2025
Reorder the characters of a string so that characters appear in descending order of their frequency, returning any valid ordering where identical characters are grouped…
Companies: Amazon, Microsoft
Last reported Oct 2025
Companies: OpenAI
Experiment Analysis & Readout
Last reported Oct 2025
Given a binary image and the coordinates of one black pixel, compute the area of the smallest axis-aligned rectangle that contains all black ('1') pixels…
Companies: Meta
Last reported Oct 2025
Given tasks with enqueue and processing times, return the order a single-threaded CPU will process them when it always picks the available task with the…
Companies: DoorDash, TikTok
Array · Heap (Priority Queue) · Sorting
Last reported Oct 2025
Given a binary tree, find the length (number of edges) of the longest path whose nodes all share the same value, where the path may…
Companies: Meta
Last reported Oct 2025
Check whether any contiguous subarray of length ≥ 2 has a sum that's a multiple of k. This reduces to using prefix-sum modulo k and…
Companies: Meta
Last reported Oct 2025
Implement a function that converts an integer to its string representation in a specified base (e.g., base 10 for decimal, base 16 for hexadecimal, base…
Companies: Microsoft
Last reported Oct 2025
Companies: Databricks
Last reported Oct 2025
Companies: Palantir
Last reported Oct 2025
Design a data structure that supports point updates and returns the sum of any submatrix in a 2D matrix, optimizing for many interleaved update and…
Companies: Moloco
Last reported Oct 2025
Design an iterator that can pause and resume its execution state through get_state and set_state methods, extending support to handle multiple files and asynchronous…
Companies: OpenAI
Last reported Oct 2025