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,051–1,075
Companies: OpenAI
Data Structure Design
Last reported Jul 2025
Find the smallest integer greater than n that uses exactly the same digits (i.e., the next lexicographic permutation of n's digits); return -1 if no…
Companies: Goldman Sachs, Meta
Last reported Jul 2025
Given a sequence of alternating moves on a 3x3 tic-tac-toe board, determine whether player A or B wins (three in a row), the game ends…
Companies: Meta
Last reported Jul 2025
Companies: Airbnb
Last reported Jul 2025
Given an n×n matrix whose rows and columns are sorted in non-decreasing order, return the k-th smallest element (counting duplicates). The core challenge is to…
Companies: Amazon, Meta
Last reported Jul 2025
Given an array that strictly increases then strictly decreases (a mountain array), find the index of the peak (maximum) element in O(log n) time by…
Companies: SoFi
Last reported Jun 2025
For each element in nums, find the first element to its right that is strictly greater and then the next strictly greater element after that…
Companies: DoorDash
Last reported Jun 2025
You are given two APIs: def list_dir(path: str) -> List[str]: """ Given a path, return the list of entries inside the directory. Return [] or…
Companies: Google
Last reported Jun 2025
Given a grid with one player S, one box B, and one target T, find the minimum number of pushes (player moving into the box…
Companies: Google
Last reported Jun 2025
You are given a bag that initially contains 2 red balls and 2 blue balls. You will repeatedly draw one ball from the bag at…
Companies: Google
Last reported Jun 2025
Companies: Anthropic
Last reported Jun 2025
Compute a + b without using + or -, by performing binary addition with bitwise operations. The core challenge is emulating addition using XOR (sum…
Companies: Meta
Last reported Jun 2025
Maintain a collection of foods with dynamic ratings that supports updating a food's rating and querying the highest-rated food for a given cuisine (ties broken…
Companies: Atlassian
Last reported Jun 2025
Write a function performing image augmentations. This question focuses on object-oriented programming, requiring you to handle input, validate it, and perform transformations…
Companies: Apple
Last reported Jun 2025
Given a list of rectangles (length, width), find the rectangle with the largest diagonal (compare l^2 + w^2 to avoid sqrt) and return its area…
Companies: Apple
Last reported Jun 2025
Given an m x n integer matrix, sort the elements along each top-left to bottom-right diagonal independently in ascending order and return the resulting matrix…
Companies: Meta
Last reported Jun 2025
Companies: Snap
Last reported Jun 2025
Compute each cell's Manhattan distance to the nearest thief, then find a path from (0,0) to (n-1,n-1) that maximizes the minimum of those distances along…
Companies: Google, Meta, Uber
Array · Binary Search · Breadth-First Search · Heap (Priority Queue)
Last reported May 2025
Given words and a target, each valid piece is any prefix of any word; return the minimum number of such prefixes that concatenate to form…
Companies: Meta
Last reported May 2025
Design a class that can store a graph with edge and node relations and includes a method to clone the graph, returning a new copy…
Companies: Meta
Last reported May 2025
Determine whether an integer's digit sequence reads the same forwards and backwards (return false for negative numbers); the follow-up asks to do this without converting…
Companies: Amazon, Bloomberg, Google, Meta +1
Math
Last reported May 2025
Multiply two matrices while exploiting sparsity to avoid needless zero multiplications: compute the product of two potentially large, sparse matrices by iterating only over…
Companies: Meta
Last reported May 2025
Delete the node with a given key from a BST while preserving BST order: search down O(height) to find the node and then handle the…
Companies: LinkedIn, Pinterest
Last reported May 2025
Companies: Meta, Pinterest
Linked List · Math · Stack
Last reported May 2025
Given a valid IPv4 address string, return its defanged version by replacing every period "." with "[.]". This is a straightforward string-manipulation problem (simple character…
Companies: Meta
Last reported May 2025