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 301–325
Implement a function that takes a list of expenses and validation rules, then returns only the expenses that violate the given rules. Design the solution…
Companies: Rippling
Last reported Aug 2026
For each price, compute the final cost as price minus the first subsequent price to its right that is <= it (or the same price…
Companies: Uber, Walmart
Array · Monotonic Stack · Stack
Last reported Aug 2026
Given two log files with date, loan type, user ID, and loan amount, identify users who have loans on both days with different loan types…
Companies: Affirm
Last reported Aug 2026
Given a nested list where elements may be integers or sublists, implement a NestedIterator with next() and hasNext() that returns all integers in depth‑first, left‑to‑right…
Companies: Adobe, LinkedIn
Depth-First Search · Design · Iterator · Queue
Last reported Aug 2026
Given a mouse in a grid, determine if the mouse can reach the cheese. The only way to manipulate the mouse is via two functions…
Companies: LinkedIn, Meta
Last reported Aug 2026
Companies: Microsoft, Snapchat
Last reported Aug 2026
Given a list of elevators, each with a current floor and direction, implement two methods: getElevator(userFloor, destinationFloor) that selects the best elevator to serve a…
Companies: Pinterest
Last reported Aug 2026
Implement job scheduling algorithms including both First Come First Serve (FCFS) and priority-based approaches. The solution should handle job submissions with start times, end…
Companies: Apple, Google, Netflix, Snowflake
Last reported Aug 2026
Find the length of the longest run of consecutive integers in an unsorted array, with an O(n) time requirement. The core idea is to detect…
Companies: Amazon, Bloomberg, Google, Microsoft +1
Array · Hash Table · Union-Find
Last reported Aug 2026
Find the length of the longest strictly increasing subsequence of nums such that each adjacent difference is ≤ k. With n up to 1e5 and…
Companies: Google
Last reported Aug 2026
Given a string s, return the longest substring that reads the same forwards and backwards. The core challenge is efficiently finding palindromic spans around centers…
Companies: Adobe, Amazon, Bloomberg, Goldman Sachs +6
Dynamic Programming · Manacher · String · Two Pointers
Last reported Aug 2026
Given a list of transactions, each with an ID, fee, and size, implement a function that returns a subset of transactions that maximizes total fees…
Companies: Coinbase
Last reported Aug 2026
Given a circular array of 5 warehouses each containing a number of products, distribute the products evenly across all warehouses while minimizing the total cost…
Companies: Amazon
Last reported Aug 2026
Given an integer array, find the minimum number of (not-necessarily-contiguous) strictly increasing subsequences you must remove to delete all elements. The core challenge is a…
Companies: Meta
Last reported Aug 2026
Given n and a blacklist of unique integers, design a data structure that returns a uniformly random integer from [0, n-1] excluding the blacklist while…
Companies: Google
Last reported Aug 2026
Companies: OpenAI
Graphs · Heaps & Priority Queues
Last reported Aug 2026
Implement a run-length encoder that compresses a string of ASCII characters, then implement a decoder that decompresses the encoded string in sub-linear time using binary…
Companies: Google
Last reported Aug 2026
Design a data structure to manage a list of meeting rooms, supporting methods to find and book the best available room for a given time…
Companies: Uber
Last reported Aug 2026
Find the graph's girth: given an undirected simple graph, return the length (number of edges) of the shortest cycle or -1 if none exists. With…
Companies: Microsoft
Last reported Aug 2026
Given a source and target string, return the minimum number of subsequences of source that need to be concatenated to form target (or -1 if…
Companies: Pinterest
Binary Search · Greedy · String · Two Pointers
Last reported Aug 2026
Given an integer array sorted in non-decreasing order (which may contain negative numbers), return a new array of the squares of each number, also sorted…
Companies: Bloomberg, Instacart, Uber
Array · Sorting · Two Pointers
Last reported Aug 2026
Design a time-based key-value store that records multiple values per key with timestamps and returns the value whose timestamp is the largest <= the queried…
Companies: Amazon, Anthropic, Apple, Citadel +8
Binary Search · Design · Hash Table · String
Last reported Aug 2026
Check whether a string of parentheses/brackets is valid by ensuring every closing bracket matches the most recent unmatched opening bracket and the types and nesting…
Companies: Amazon, Apple, Bloomberg, Google +9
Bracket Sequences · Stack · String
Last reported Aug 2026
Determine if a 3x3 Tic-Tac-Toe board is reachable under normal play by checking counts of X and O and detecting winning lines, ensuring any win(s)…
Companies: Microsoft
Last reported Aug 2026
Implement a pseudo-random generator that uses XOR operations. Use its output to transform a tree document and reverse that transformation. Verify that decoding restores the…
Companies: Baseten
Bit Manipulation · Serialization · Trees
Last reported Aug 2026