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 126–150
Given a bitonic array (an array that first increases then decreases), implement an efficient algorithm to search for a target element. Handle variations such as…
Companies: Bloomberg
Last reported Sep 2026
Given an array of integers and a target value, find or count contiguous (consecutive) subarrays whose sum equals the target. The core challenge is to…
Companies: Meta
Last reported Sep 2026
Determine whether the string s can be segmented into a sequence of one or more words from wordDict (words may be reused). The core challenge…
Companies: Amazon, Google, Grammarly, Meta +3
Array · Brute-Force Search · Dynamic Programming · Hash Table
Last reported Sep 2026
Tokenize the sentence by spaces and for each word that exactly matches a dollar sign followed by digits, compute price * (100 - discount) /…
Companies: Amazon
Last reported Sep 2026
Count the number of islands (4-directionally connected components of '1's) in an m×n binary grid. This is a connected-components/flood-fill problem typically solved with…
Companies: Amazon, Anduril, Apple, ByteDance +16
Array · Breadth-First Search · Depth-First Search · Matrix
Last reported Sep 2026
Implement a text editor with a movable cursor that supports inserting text at the cursor, deleting up to k characters to the left (backspace), moving…
Companies: Google, Microsoft
Last reported Sep 2026
Implement a card hand comparison system for a simplified poker game where each player holds up to 4 cards, supporting standard hand rankings (high card…
Companies: Rippling
Last reported Sep 2026
Return the index of the first character in s that occurs exactly once (or -1 if none). This is typically solved by counting character frequencies…
Companies: Apple, Goldman Sachs
Counting · Hash Table · Queue · String
Last reported Sep 2026
Implement the core logic of a Candy Crush-style game where groups of 3 or more matching items aligned horizontally, vertically, or diagonally are identified and…
Companies: Roblox
Last reported Sep 2026
Given a string s, compress it using regular characters and a special '*' character. The '*' acts as a macro that repeats the entire sequence…
Companies: Goldman Sachs
Last reported Sep 2026
Return the words that can be typed using letters from only one row of a US QWERTY keyboard (case-insensitive), i.e., all characters of a word…
Companies: Apple
Last reported Sep 2026
Given repeating bus routes and start/target stops, find the minimum number of bus rides required to go from source to target (or -1 if impossible)…
Companies: Amazon, Bloomberg, Coupang, PayPal +3
Array · Breadth-First Search · Hash Table
Last reported Sep 2026
Given an undirected graph (n up to 2×10^5) as an edge list, determine whether there exists any path between the given source and destination vertices…
Companies: Meta, Microsoft, Whatnot
Last reported Sep 2026
Companies: Adobe, Amazon, Bloomberg, Microsoft
Depth-First Search · Doubly-Linked List · Linked List
Last reported Sep 2026
Given a set of rectangles on a 2D plane, find the maximum number of rectangles that can be crossed by a single straight vertical or…
Companies: Google
Last reported Sep 2026
Find the minimum-cost path from any cell in the first row to any cell in the last row of an m×n grid where you may…
Companies: Walmart
Last reported Sep 2026
For each query threshold, compute how many distinct cells you can reach from the top-left by moving 4-directionally through cells whose value is strictly less…
Companies: Uber
Array · Breadth-First Search · Heap (Priority Queue) · Matrix
Last reported Sep 2026
Given a sequence of request timestamps (or events) and throttling rules (e.g., at most K requests per time window or a required cooldown between same…
Companies: Google, Microsoft, Plaid, Roblox
Last reported Sep 2026
Companies: OpenAI
Data Structure Design · Trees
Last reported Sep 2026
Find all unique triplets in an integer array that sum to zero, ensuring no duplicate triplets in the output. The core challenge is efficiently enumerating…
Companies: Amazon, Apple, Bloomberg, Google +5
Array · Sorting · Two Pointers
Last reported Sep 2026
Companies: Anthropic
String Algorithms
Last reported Sep 2026
Determine whether the matchsticks can be partitioned into four groups with equal total length (forming the four sides of a square) using every stick exactly…
Companies: eBay
Last reported Sep 2026
Given the root of a binary tree, return the diameter — the maximum number of edges on any path between two nodes; the core challenge…
Companies: Meta, Oracle, Roblox
Binary Tree · Depth-First Search · DP on Trees · Tree
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
Determine whether a given integer array is monotonic — either entirely non-decreasing or entirely non-increasing — by verifying the ordering of adjacent elements (expected O(n)…
Companies: Meta, Palo Alto Networks
Last reported Sep 2026