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–25
Given a list of meeting time intervals, determine the minimum number of conference rooms required so that no meetings overlap. The core challenge is computing…
Companies: Amazon, Apple, Google, Meta +9
Array · Greedy · Heap (Priority Queue) · Prefix Sum
Last reported Nov 2026
Given an integer array nums and two integers k and m, perform at most k increment operations on any elements, then return the maximum possible…
Companies: Amazon
Array · Bit Manipulation · Greedy · Sorting
Last reported Oct 2026
Given non-overlapping segments where every integer position in [li, ri] holds ci coins, find the maximum total coins covered by any contiguous window of k…
Companies: Amazon
Array · Binary Search · Greedy · Prefix Sum
Last reported Oct 2026
Given arrays of box heights and warehouse room heights, maximize how many boxes can be placed knowing a box can only reach a room if…
Companies: Pinterest
Array · Greedy · Sorting
Last reported Oct 2026
Given a binary array representing a flowerbed (0 = empty, 1 = planted) with no adjacent 1s, determine if you can add n new flowers…
Companies: LinkedIn, Meta
Array · Greedy
Last reported Sep 2026
Given an array where nums[i] is the maximum forward jump from index i, compute the minimum number of jumps needed to reach the last index…
Companies: Amazon, Flipkart, Salesforce
Array · Dynamic Programming · Greedy
Last reported Sep 2026
Given tasks labeled A–Z and a cooldown n, compute the minimum number of CPU intervals (including idles) to finish all tasks so that identical tasks…
Companies: Amazon, Apple, Databricks, Docker +3
Array · Counting · Greedy · Hash Table
Last reported Sep 2026
Given an array of building heights and limited bricks and ladders, find the furthest building index you can reach from 0 by covering each positive…
Companies: D. E. Shaw, SchröDinger
Array · Greedy · Heap (Priority Queue)
Last reported Aug 2026
Given a source and target string, return the minimum number of subsequences of source that need to be concatenated to form target (or -1 if…
Companies: Pinterest
Binary Search · Greedy · String · Two Pointers
Last reported Aug 2026
Choose an integer x in [0, 2^n) to maximize (a XOR x) * (b XOR x) (answer mod 1e9+7); the core challenge is picking x’s…
Companies: Atlassian, Cisco, Zomato
Bit Manipulation · Greedy · Math
Last reported Jul 2026
Determine whether a string containing '(', ')', and '*' (where '*' can represent '(', ')', or empty) can be assigned so the parentheses are balanced…
Companies: Apple, Microsoft, Oracle
Bracket Sequences · Dynamic Programming · Greedy · Stack
Last reported Jul 2026
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
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 two arrays gas and cost around a circular route, find the unique starting station index from which you can travel clockwise once without your…
Companies: Adobe, Bloomberg, Expedia, Goldman Sachs +2
Array · Greedy
Last reported Jun 2026
Given an array where each value is the maximum jump length from that index, determine whether you can reach the last index starting from the…
Companies: Amazon, Meta, Microsoft
Array · Dynamic Programming · Greedy
Last reported Jun 2026
Companies: OpenAI
Greedy · Job Scheduling & Workflows
Last reported Apr 2026
Given daily stock prices, compute the maximum profit you can achieve with unlimited buy/sell operations while holding at most one share at a time (you…
Companies: Apple, Bloomberg, Meta, Oracle
Array · Dynamic Programming · Greedy
Last reported Mar 2026
Split the array into k non-empty contiguous subarrays so that the maximum subarray sum is as small as possible, and return that minimized largest sum…
Companies: Amazon, Google, Microsoft, Pinterest +2
Array · Binary Search · Dynamic Programming · Greedy
Last reported Feb 2026
Given a string of '(' and ')', return the minimum number of parentheses insertions needed to make the string valid. This is solved greedily by…
Companies: Meta, Microsoft
Bracket Sequences · Greedy · Stack · String
Last reported Dec 2025
Given a string of '(' and ')', return the minimum number of insertions needed to make it balanced under the rule that each '(' must…
Companies: Bloomberg, Meta
Bracket Sequences · Greedy · Stack · String
Last reported Mar 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
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
Assign dry operations on zero days so that no lake is rained on while already full: given a sequence where rains[i]>0 fills a lake and…
Companies: MongoDB
Array · Binary Search · Greedy · Hash Table
Place n unit cubes into stacks on an n×n floor with the rule that a cube can be stacked only if the supporting cube's four…
Companies: Adobe
Binary Search · Greedy · Math
Given heights of vertical lines at unit-spaced x-coordinates, pick two indices i<j to maximize the area min(height[i],height[j])*(j-i). With n up to 1e5, the problem requires…
Companies: Amazon, Bloomberg, Cisco, Flipkart +4
Array · Greedy · Two Pointers