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 226–250
Implement a data structure for Loose Median with constant time and space complexity for insert and looseMedian operations. The Loose Median is defined as any…
Companies: Google
Last reported Aug 2026
Companies: Amazon, Meta, NVIDIA, Oracle +3
Divide and Conquer · Heap (Priority Queue) · Linked List · Merge Sort
Last reported Aug 2026
Given up to 50 unique 2D points, find the minimum-area rectangle (sides may be rotated) whose four vertices are in the set. Key insight: any…
Companies: Google
Last reported Aug 2026
Given a directed graph where each edge has an associated security clearance level, find the minimum security clearance level required to travel from a source…
Companies: Google
Last reported Aug 2026
Simulate batched buy/sell order matching where each buy matches with the lowest-price sell (and each sell with the highest-price buy), allowing partial fills until no…
Companies: Amazon, Citadel
Array · Heap (Priority Queue) · Simulation
Last reported Aug 2026
Given per-house well costs and candidate pipe connections with costs, choose wells and pipes to supply water to all houses at minimum total cost. Model…
Companies: Amazon, Phonepe
Last reported Aug 2026
Design an iterator for a photo album that yields favourite photos first, followed by the remaining photos in their original order, with no duplicates. The…
Companies: Google
Last reported Aug 2026
Given a list of non-overlapping half-open intervals [start, end), where each interval covers the integers start, start+1, ..., end-1, and a 0-based index idx, find…
Companies: Databricks
Last reported Aug 2026
Given a numeric string S and an integer X, return a string representation of S rounded to X significant digits, with thousand separators applied where…
Companies: Google, Pinterest
Last reported Aug 2026
Given a string containing words separated by spaces, split it into tokens where spaces outside single quotes act as delimiters and spaces inside single quotes…
Companies: Google
Last reported Aug 2026
Given an array of integers and a target value, determine if there exists a contiguous subarray whose sum equals the target.
Companies: Meta
Last reported Aug 2026
Given a tree of N outposts connected by N-1 bidirectional tunnels, process M queries that either designate an outpost as a Supply Outpost or find…
Companies: LinkedIn
Last reported Aug 2026
Given a target sum and a list of positive integers (e.g., coin values), count how many distinct ways to form that sum under the problem's…
Companies: LinkedIn
Last reported Aug 2026
Given a string s and a word dictionary, return all possible sentences formed by inserting spaces so every token is a dictionary word — i.e.…
Companies: Bloomberg, Meta, ServiceNow
Array · Backtracking · Dynamic Programming · Hash Table
Last reported Aug 2026
Design a data structure that maintains a dynamic set of half-open intervals supporting addRange (insert and merge overlaps), removeRange (subtract and split intervals), and…
Companies: Google, Microsoft
Last reported Aug 2026
Check whether a binary tree is symmetric around its center by determining if the left and right subtrees are mirror images of each other. This…
Companies: Apple, LinkedIn, TikTok
Last reported Aug 2026
Write pseudocode (or code) to implement a concurrent file logger that optimizes write throughput when multiple threads log to a single file. The solution should…
Companies: Databricks
Last reported Aug 2026
Use the API that reports whether a guess is too high, too low, or correct to identify the secret number in [1, n]; this is…
Companies: OpenAI
Last reported Aug 2026
Implement a function in Java that processes a given order and applies discounts to cart items based on their respective categories. The solution should correctly…
Companies: M&S, Wayfair
Last reported Aug 2026
Build a service that ingests user availability intervals and, given a prompt specifying a subset of users and a required duration, returns all time windows…
Companies: Gong
Last reported Aug 2026
Check whether two binary trees produce the same left-to-right sequence of leaf node values — i.e., extract each tree’s leaf values in order and return…
Companies: Google, Snowflake
Last reported Aug 2026
Given a dependency graph where dependentFlights[x] contains every flight that directly depends on flight x, determine which flights are delayed using a multi-source…
Companies: Oracle
Last reported Aug 2026
Given a circular array of nonnegative values where robbing two adjacent houses is forbidden, find the maximum total amount you can rob without alerting the…
Companies: Amazon, Digitalocean, Microsoft
Last reported Aug 2026
Given a large social graph, compute for each user the top-k recommended new friends (excluding existing connections) ranked by mutual-friend or interaction-based score; the…
Companies: Google
Last reported Aug 2026