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 26–50
Given a list of intervals (endpoints touching allowed), find the minimum number to remove so the remaining intervals are pairwise non-overlapping — equivalently, select the…
Companies: Amazon, Docusign, Grammarly
Array · Dynamic Programming · Greedy · Sorting
Last reported Jul 2026
Choose a subset of non-overlapping jobs (jobs may touch at endpoints) to maximize total profit — the classical weighted interval scheduling problem. With up to…
Companies: Airbnb
Array · Binary Search · Dynamic Programming · Sorting
Last reported Jun 2026
Given a list of intervals [x_start, x_end] (endpoints inclusive), find the minimum number of points on the x-axis (vertical arrows) such that each interval contains…
Companies: Amazon, Atlassian, Expedia, Google
Array · Greedy · Sorting
Last reported Jun 2026
Given an integer array, return the maximum product obtainable by multiplying any three numbers. Consider both the three largest values and the combination of the…
Companies: Salesforce
Array · Math · Sorting
Last reported Jun 2026
Given a binary grid, count how many distinct island shapes (connected components of 1s via 4-directional adjacency) appear, treating two islands as identical if they…
Companies: Anduril, Oracle, TikTok
Array · Breadth-First Search · Depth-First Search · Hash Function
Last reported Jun 2026
Design an online autocomplete system that processes characters one-by-one, returning the top 3 historically most frequent sentences that match the current prefix (ranked by…
Companies: Google, Netflix, Pinterest, Vercel
Data Stream · Depth-First Search · Design · Heap (Priority Queue)
Last reported May 2026
Given two sorted arrays nums1 and nums2 and counts m and n (nums1 has length m+n with its last n slots free), merge the elements…
Companies: Amazon, Bloomberg, Google, Meta +2
Array · Sorting · Two Pointers
Last reported Apr 2026
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
Partition the array so that all even numbers appear before all odd numbers, returning any arrangement that satisfies this; order within the even/odd groups doesn't…
Companies: Meta, Zoho
Array · Sorting · Two Pointers
Last reported Jan 2025
Rearrange the characters of a string so that no two adjacent characters are the same, returning any valid permutation or "" if none exists. Key…
Companies: Amazon, D. E. Shaw, Tesla
Counting · Greedy · Hash Table · Heap (Priority Queue)
Last reported Jan 2025
Find all pairs of distinct integers that achieve the minimum absolute difference; the typical approach is to sort the array and collect adjacent pairs with…
Companies: Amazon, Walmart Labs
Array · Sorting
Last reported Nov 2024
Reorder an array of values 0, 1, and 2 in-place so all 0s come first, then 1s, then 2s (the Dutch National Flag problem); aim…
Companies: Amazon, Google, Microsoft, Walmart Labs
Array · Bubble Sort · Quicksort · Sorting
Last reported Oct 2024
Return true if any integer appears at least twice in the array and false if all elements are distinct. Array length can be up to…
Companies: Google, Meta
Array · Hash Table · Sorting
Last reported Oct 2024
Given a string and allowed index swap pairs, view pairs as edges in a graph to find connected components where characters can be freely permuted…
Companies: Goldman Sachs, Google
Array · Breadth-First Search · Depth-First Search · Hash Table
Last reported Oct 2024
Given an integer array and a target, find three numbers whose sum is closest to the target (unique solution guaranteed) and return that sum. This…
Companies: Bloomberg
Array · Sorting · Two Pointers
Find all unique quadruplets of distinct elements in an integer array whose values sum to a given target. Results must avoid duplicates (order irrelevant); with…
Companies: Oracle
Array · Sorting · Two Pointers
Given two equal-length arrays, permute nums1 to maximize the number of positions where nums1[i] > nums2[i]. This is a greedy matching problem: sort nums1 and…
Companies: Walmart Labs
Array · Greedy · Sorting · Two Pointers
Given a string with brace-enclosed comma-separated option groups and implicit concatenation (e.g., "{a,b}c{d,e}"), generate all unique strings formed by choosing one option…
Companies: Anduril
Backtracking · Breadth-First Search · Sorting · Stack
Given positions of houses and heaters on a line, find the minimum uniform radius R such that every house is within distance R of some…
Companies: Anduril
Array · Binary Search · Sorting · Two Pointers
Given a list of (studentId, score) pairs, compute each student's average of their top five scores and return the results as (studentId, average) sorted by…
Companies: Goldman Sachs
Array · Hash Table · Heap (Priority Queue) · Sorting
You may swap two indices iff their values differ by at most limit; compute the lexicographically smallest array obtainable by any sequence of such swaps…
Companies: Goldman Sachs, Uber
Array · Sorting · Union-Find
Given a weighted tree, remove edges so that each node's degree in the remaining forest is at most k while maximizing the total weight of…
Companies: LinkedIn, Uber
Depth-First Search · Dynamic Programming · Sorting · Tree
Given an integer array, find the maximum difference between successive elements in its sorted order; if fewer than two elements return 0. The catch is…
Companies: Waymo
Array · Bucket Sort · Pigeonhole Principle · Radix Sort
Convert each point to its polar angle around your location (counting points at the exact location separately), sort these angles and handle the circular wrap…
Companies: Anduril
Array · Geometry · Math · Sliding Window
Choose k workers and pay each proportional to quality while meeting their minimum wages; the group's cost equals (sum of selected qualities) * max(wage[i]/quality[i]) among…
Companies: Apple
Array · Greedy · Heap (Priority Queue) · Sorting