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 251–275
Given a list of words, find the length of the longest chain where each next word is formed by inserting exactly one letter into the…
Companies: Cohesity
Last reported Aug 2026
Given a string, perform k single-character updates and after each update return the length of the longest substring made of a single repeated character; with…
Companies: Digitalocean
Last reported Aug 2026
Implement a function to calculate capital gains tax based on a set of predefined rules and formulas. The solution should correctly apply the relevant tax…
Companies: Nubank
Last reported Aug 2026
Given coordinates of two axis-aligned rectangles, compute the total area covered by both. The key is to sum their individual areas and subtract the area…
Companies: General Motors, Google
Last reported Aug 2026
Given a list of rectangular buildings [left, right, height], compute the skyline as the sequence of key points where the maximum building height changes across…
Companies: Amazon, General Motors, Pinterest
Last reported Aug 2026
Compute the sum of every node's tilt in a binary tree, where a node's tilt is the absolute difference between the sum of values in…
Companies: Microsoft
Last reported Aug 2026
Given an array of n integers, return the element that appears more than ⌊n/2⌋ times (the majority element is guaranteed to exist). The goal is…
Companies: Amazon, Bloomberg, Coupang, Google +1
Array · Boyer–Moore Majority Vote Algorithm · Counting · Divide and Conquer
Last reported Aug 2026
Given a grid with buildings (1), empty land (0), and obstacles (2), find an empty cell that minimizes the sum of shortest (Manhattan) path distances…
Companies: Amazon, Coupang, DoorDash, Goldman Sachs +2
Array · Breadth-First Search · Matrix
Last reported Aug 2026
Given an array of integers and a target, return the indices of two distinct elements whose values sum to the target (exactly one valid solution…
Companies: Amazon, Apple, Bloomberg, Brex +13
Array · Hash Table
Last reported Aug 2026
Implement an infection simulation on a grid. Extend the simulation with immune cells and a recovery countdown for each affected cell.
Companies: OpenAI
Grid Traversal · Simulation · Simulation & State Machines · State Machines
Last reported Aug 2026
Find the substring (overlaps allowed) that occurs most often in s among those with length between minSize and maxSize and at most maxLetters distinct characters…
Companies: Chewy, LinkedIn, Microsoft
Hash Table · Sliding Window · String
Last reported Aug 2026
Create a function that generates a license plate based on specific rules and formats. The function should take input parameters such as the number of…
Companies: Google
Last reported Aug 2026
Given an n x n symmetric adjacency matrix where isConnected[i][j]=1 denotes a direct undirected edge between cities, count the number of connected components (provinces) formed…
Companies: Amazon, Coupang, Uber
Breadth-First Search · Depth-First Search · Graph Theory · Union-Find
Last reported Aug 2026
A fox needs to cross a river by jumping on logs, with the ability to jump up to 3 logs at a time. Determine the…
Companies: Agoda
Last reported Aug 2026
Given a sorted integer array and a target value x, return the k integers closest to x in ascending order. Ties are broken by preferring…
Companies: Asana, Meta, Microsoft
Last reported Aug 2026
Given N points on the plane and an integer k, return the k points with the smallest Euclidean distance to the origin (order doesn't matter)…
Companies: Airbnb, Amazon, Asana, Meta
Array · Divide and Conquer · Geometry · Heap (Priority Queue)
Last reported Aug 2026
Given a set of filter parameters and a collection of log lines, implement a parser that matches log entries against the provided filters. Return all…
Companies: Datadog
Last reported Aug 2026
Given timestamped friendship events among N people, determine the earliest time when the social graph becomes fully connected; process events in chronological order and use…
Companies: Amazon, Google, Uber
Array · Sorting · Union-Find
Last reported Aug 2026
Companies: Monzo, Opendoor, Ramp
Last reported Aug 2026
Implement a rate limiting algorithm that accepts a unique key, a time period in seconds, and a maximum call count, and determines whether additional calls…
Companies: Bloomberg, Intuit, Microsoft, MongoDB
Last reported Aug 2026
Given a master directory path, use helper functions to retrieve and merge multiple JSON-like configuration files, where more specific configurations can override default…
Companies: Yelp
Last reported Aug 2026
Given an array of file access logs, calculate how frequently each file was accessed during each hour of the day. Use this data to determine…
Companies: Yelp
Last reported Aug 2026
Given a multiset of candidate numbers, return all unique combinations that sum to the target where each candidate may be used at most once. This…
Companies: Expedia, LinkedIn, Meta, Microsoft +1
Last reported Aug 2026
Design a system that records passenger check-ins and check-outs and returns the average direct travel time between two stations. The core challenge is maintaining active…
Companies: Apple, Axon, Bloomberg, Ramp
Last reported Aug 2026
Given two matrices stored in binary files, implement matrix multiplication without using built-in functions by manually computing each output value using the row-by-column dot…
Companies: Intuit
Last reported Aug 2026