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 176–200
Given a directed acyclic graph representing service dependencies, calculate the worst-case load factor for each service, defined as the total units of load it receives…
Companies: Robinhood
Last reported Sep 2026
Given a BST, a real-valued target and an integer k, return the k node values in the tree closest to the target. The challenge is…
Companies: Amazon, LinkedIn
Binary Search Tree · Binary Tree · Depth-First Search · Heap (Priority Queue)
Last reported Sep 2026
Given an integer array `nums`, return the number of index triplets `(i, j, k)` where `0 <= i < j < k < len(nums)` and…
Companies: Expedia
Last reported Sep 2026
Construct a substitution cipher by recording the first occurrence of each lowercase letter in key (which is guaranteed to contain all 26 letters) and mapping…
Companies: Google
Last reported Sep 2026
Delete the nodes whose values are in to_delete from a binary tree and return the roots of the resulting forest. The core challenge is traversing…
Companies: Google
Last reported Sep 2026
Design a system that stores tax records (tax amount, employee ID, timestamp) and retrieves the total tax amount for a given employee over the past…
Companies: Check
Last reported Sep 2026
Design a spreadsheet supporting set/get and sum operations where sum formulas can reference individual cells and rectangular ranges; the core challenge is maintaining a…
Companies: Airbnb, Discord
Array · Design · Graph Theory · Hash Table
Last reported Sep 2026
Implement a HashMap for integer keys/values without using built-in hash table libraries that supports put, get, and remove operations. The core challenge is to design…
Companies: Anduril, Canva, Chewy, Goldman Sachs +2
Array · Design · Hash Function · Hash Table
Last reported Sep 2026
Design a Spreadsheet class with 26 columns and a specified number of rows that supports setCell and resetCell operations and stores integer values (unset cells…
Companies: Citadel, Discord
Array · Design · Hash Table · Matrix
Last reported Sep 2026
Given a total amount of money and a number of people, distribute the money as evenly as possible among all people. Minimize the difference between…
Companies: Pinterest
Last reported Sep 2026
Given pairwise variable ratios, build a weighted graph (or use union-find with multiplicative weights) where edges represent divisions, and answer each query by finding a…
Companies: Amazon, Bloomberg
Array · Bellman–Ford Algorithm · Breadth-First Search · Depth-First Search
Last reported Sep 2026
In two parts: first, implement a simple Bank class supporting deposit, withdraw, and transfer operations with account validation. Then, extend the class to track account…
Companies: Capital One
Last reported Sep 2026
Given integers n, start, and end, find a path from the start node to the end node in a Fibonacci tree of order n, where…
Companies: Databricks
Last reported Sep 2026
Convert a fraction to its decimal string form, enclosing any repeating fractional cycle in parentheses. The core challenge is simulating long division while handling sign…
Companies: Goldman Sachs, Meta
Hash Table · Math · String
Last reported Sep 2026
Count the number of ordered pairs (x → y), x ≠ y, such that age[y] > 0.5*age[x] + 7, age[y] ≤ age[x], and not (age[y]…
Companies: Meta
Last reported Sep 2026
Implement a system to evaluate and apply expense rules for credit card transactions. Given a set of conditions and actions, determine which rules apply to…
Companies: Rippling
Last reported Sep 2026
Design and implement a social follow graph that supports snapshotting the state of relationships at a given point in time and generating friend/follow recommendations based…
Companies: OpenAI
Data Structure Design · Graphs
Last reported Sep 2026
Given a list of transactions, mark any transaction invalid if its amount > 1000 or if there exists another transaction with the same name within…
Companies: Bloomberg
Last reported Sep 2026
Given a list of directed edges representing relationships between nodes, find the length of the longest directed path in the graph. A directed path is…
Companies: Oscar Health
Last reported Sep 2026
Given an m x n grid, return the length of the longest strictly increasing path you can make by moving up/down/left/right; the core challenge is…
Companies: Meta, Microsoft, Snapchat
Last reported Sep 2026
Find the contiguous subarray within an integer array that yields the maximum possible sum and return that sum. This is typically solved in O(n) with…
Companies: Amazon, Google, LinkedIn, Meta +5
Array · Divide and Conquer · Dynamic Programming
Last reported Sep 2026
Given a route with N possible overnight stops and their cumulative travel times, determine the optimal placement of K overnight stops to minimize the longest…
Companies: Pinterest
Last reported Sep 2026
Given m nodes arranged in a circular ring where a drone can move to adjacent nodes with given transition times, calculate the minimum total travel…
Companies: Amazon
Last reported Sep 2026
Given a list of words, return the most frequently occurring word. If two words share the highest frequency, return the one that appears latest in…
Companies: Amazon
Last reported Sep 2026
Count the number of 4-directionally connected components of 0s in a binary grid that are completely surrounded by 1s (i.e., the component does not touch…
Companies: Amazon, Google
Last reported Sep 2026