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 151–175
Companies: OpenAI
Graphs · Heaps & Priority Queues
Last reported Sep 2026
Given a URL that returns IDs for reachable paths, navigate through the maze by making API calls while avoiding cycles from previously visited IDs. Implement…
Companies: Ramp
Last reported Sep 2026
Given an org chart, write an algorithm to determine the lowest common parent of a list of children. Expected to build the graph on my…
Companies: Amazon, Atlassian, Microsoft, Spotify
Last reported Sep 2026
Given an absolute Unix-style path, produce its canonical simplified form by collapsing multiple slashes and resolving "." (current dir) and ".." (parent dir) references. This…
Companies: Meta, NVIDIA, Roblox, Snowflake
Stack · String
Last reported Sep 2026
Given an ordered list of task types and a cooldown "space", find the minimum total days (including required breaks) to finish all tasks while ensuring…
Companies: Amazon
Last reported Sep 2026
Implement a thread pool using the concurrency primitives available in your programming language of choice. Your solution should support submitting tasks for execution and…
Companies: Temporal
Last reported Sep 2026
For each string in an array, find the shortest substring that does not occur in any other string (choose the lexicographically smallest one among ties)…
Companies: Airbnb
Array · Hash Table · String · Trie
Last reported Sep 2026
Given an array of coin costs (with some positions possibly blocked) and a maximum jump length B, find a sequence of jumps from the first…
Companies: Oracle
Last reported Sep 2026
Companies: OpenAI
Graphs · Grids & Matrices
Last reported Sep 2026
Return the k-th largest element (by sorted order, not distinct) from an unsorted array. For inputs up to ~1e5 elements, solve it faster than full…
Companies: Bloomberg, LinkedIn, Meta, Salesforce +1
Array · Divide and Conquer · Heap (Priority Queue) · Quickselect
Last reported Sep 2026
Find the smallest substring of s that contains all characters of t (including duplicates), or return "" if none exists. This is typically solved with…
Companies: Amazon, LinkedIn, Lyft, Meta +2
Hash Table · Sliding Window · String
Last reported Sep 2026
Count the number of non-empty subsequences whose minimum plus maximum is ≤ target (answer mod 1e9+7). With n up to 1e5, the usual efficient approach…
Companies: LinkedIn
Last reported Sep 2026
Given an ascending array of distinct integers that has been rotated at an unknown pivot, return the index of a target value (or -1 if…
Companies: Amazon, Expedia, Google, LinkedIn +3
Array · Binary Search
Last reported Sep 2026
Implement a function that parses a CSV-formatted string containing business verification records and validates each record against a set of required fields and formatting rules.
Companies: Oracle, Stripe
Last reported Sep 2026
Traverse the m×n matrix in clockwise spiral order (right, down, left, up) and return the elements in that sequence. The core challenge is managing changing…
Companies: Capital One, Liveramp, Meta, Microsoft +1
Array · Matrix · Simulation
Last reported Sep 2026
Return the values of a binary tree grouped by depth, from left to right for each level (i.e., a level-order / breadth-first traversal). For an…
Companies: Meta, Visa, Zscaler
Last reported Sep 2026
Given a binary tree, count how many subtrees are "univalue" (every node in the subtree has the same value). The core challenge is to determine…
Companies: Grab
Last reported Sep 2026
Design a data structure for a multiset that supports insert(val) (adding even duplicate occurrences), remove(val) (removing a single occurrence), and getRandom() (returning an…
Companies: CrowdStrike, LinkedIn, Okta
Array · Design · Hash Table · Math
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
Check whether every node in a binary tree has the same value as the root; return true if all nodes match, false otherwise. This can…
Companies: Grab
Last reported Sep 2026
Given N locks and a set of operations (each with a time cost) that can simultaneously change the state of a subset of locks, find…
Companies: Microsoft
Last reported Sep 2026
Implement the backend logic for the 2048 game, supporting swipe movements in all four directions (left, right, up, down). Tiles with the same value should…
Companies: Glean
Last reported Sep 2026
Given a start time, end time, and tiered pay rates that vary based on time of day (e.g., different rates after midnight), calculate the total…
Companies: Upstart
Last reported Sep 2026
Given an array of bad words and a user-provided string, determine if the string contains any bad words, accounting for common letter substitutions such as…
Companies: Discord
Last reported Sep 2026
Count how many distinct integers appear as the bitwise OR of any non-empty contiguous subarray of arr. Key insight: bitwise OR only accumulates bits so…
Companies: Amazon, Microsoft
Last reported Sep 2026