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 201–225
Given an initially all-water m×n grid, process a sequence of add-land operations and return the number of islands (4-directionally connected land components) after each…
Companies: LinkedIn, Microsoft, Uber
Array · Hash Table · Union-Find
Last reported Sep 2026
Given n houses and k paint colors with a cost matrix, choose a color for each house so no two adjacent houses share a color…
Companies: LinkedIn
Last reported Sep 2026
Count the number of contiguous substrings of s that are palindromes. With |s| up to 1000, the core challenge is to enumerate/detect all palindromic centers…
Companies: Goldman Sachs, Meta, Microsoft
Dynamic Programming · String · Two Pointers
Last reported Sep 2026
Given n courses and prerequisite pairs, determine the minimum number of semesters required to finish all courses if you can take any number of courses…
Companies: Snowflake
Last reported Sep 2026
For each index in an integer array, compute the product of all other elements without using division and in O(n) time — typically done by…
Companies: Amazon, Asana, Meta, Snap
Array · Prefix Sum
Last reported Sep 2026
Determine whether ransomNote can be formed from magazine by verifying that for every character, magazine contains at least as many occurrences as needed — i.e.…
Companies: Anduril, Pinterest
Counting · Hash Table · String
Last reported Sep 2026
Given a 2D grid of a specified size, start coordinates, and end coordinates, find the shortest path between the two points. The problem is presented…
Companies: Amazon, Anduril
Last reported Sep 2026
Design a Bank class that maintains 1-indexed account balances and supports transfer, deposit, and withdraw operations; each operation must validate account indices and (for…
Companies: Capital One, Coinbase, Okta, OpenAI +1
Last reported Sep 2026
Design a Snake game class with a 40x30 screen, wrapping boundaries, automatic growth every 5 moves, and collision detection for game over conditions.
Companies: Atlassian, Watershed
Last reported Sep 2026
Design a versioned array that supports point updates, taking snapshots (returning increasing snap_ids), and querying the value at an index for a given snap_id. The…
Companies: Amazon, Anduril, Apple, Google DeepMind +1
Array · Binary Search · Design · Hash Table
Last reported Sep 2026
Given two APIs to retrieve a person's purchases and friends, implement a function that returns all items purchased by a user's friends (excluding items the…
Companies: Amazon
Last reported Sep 2026
Parse a URL query string into a key-value map, where values can be a boolean (for keys with no value), a string, or a list…
Companies: Airbnb
Last reported Sep 2026
Given a sorted list of words in an unknown alphabet, infer the relative ordering of characters by deriving precedence constraints between first differing letters, then…
Companies: Amazon, Bloomberg, Google, Intuit +3
Array · Breadth-First Search · Depth-First Search · Directed Acyclic Graph
Last reported Aug 2026
Given an array of balloon values, find the maximum coins you can collect by bursting balloons optimally. When you burst balloon at index i, you…
Companies: Amazon, Apple, Google
Last reported Aug 2026
Given a line of children with integer ratings, assign each at least one candy so any child with a higher rating than a neighbor gets…
Companies: LinkedIn, Marvin, PayPal
Last reported Aug 2026
Given N cars and a list of rental requests (each with pickup time, return time, and ID), assign cars to requests using the minimum number…
Companies: Amazon, Google, Waymo
Last reported Aug 2026
Design a data structure that supports three operations, all in average O(1) time: - insert(val): adds val to the data structure if not already present…
Companies: Nebuis
Last reported Aug 2026
Implement a multi-level package tracking system supporting: recording parcel events under an assigned courier (RecordCourierEvent), querying total event counts per courier…
Companies: Airbnb
Last reported Aug 2026
Return the elements of a possibly jagged 2D array in diagonal (anti-diagonal) order, where cells on the same diagonal share the same i+j value and…
Companies: Meta
Last reported Aug 2026
Compute the minimum number of single-character insertions, deletions, or replacements needed to transform word1 into word2 (the classic Levenshtein edit distance), typically…
Companies: Amazon, LinkedIn
Last reported Aug 2026
Given a binary search tree, return the left side view from bottom to top, and the right side view from top to bottom. Ensure there…
Companies: Meta
Last reported Aug 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
Group strings that are equivalent under a uniform alphabetical shift (e.g., "abc" → "bcd", with wrap-around) by identifying a shift-invariant signature for each string and…
Companies: Google, Meta
Last reported Aug 2026
Given a start IPv4 address and a number of consecutive addresses, produce the minimal list of CIDR blocks that exactly cover that range. The key…
Companies: Databricks
Bit Manipulation · String
Last reported Aug 2026
Given a string of digits 2–9, return all possible letter strings by mapping each digit to its phone-keypad letters — effectively computing the Cartesian product…
Companies: Amazon, Google, LinkedIn, Microsoft +1
Backtracking · Hash Table · String
Last reported Aug 2026