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 601–625
Given a reference to a node in a connected undirected graph, produce a deep copy that recreates every node and its adjacency lists. Ensure cycles…
Companies: LinkedIn, Meta
Last reported Apr 2026
Find any index of a "peak" (an element strictly greater than its neighbors, with array ends treated as -∞) in an integer array where adjacent…
Companies: Adobe, Meta
Array · Binary Search
Last reported Apr 2026
Given lists where each entry names a parent region followed by its immediate subregions and two region names, find their smallest common region — the…
Companies: Airbnb
Array · Binary Lifting · Breadth-First Search · Depth-First Search
Last reported Apr 2026
Given a main axis-aligned bounding box (x1, y1, x2, y2) and a list of other axis-aligned bounding boxes, write a function that computes the total…
Companies: Qsc
Last reported Apr 2026
Companies: OpenAI
Database Internals · Key-Value Stores
Last reported Apr 2026
Find the length of the longest contiguous subarray whose maximum minus minimum is ≤ limit; the key challenge is maintaining the window's current min and…
Companies: MongoDB, Uber
Array · Heap (Priority Queue) · Monotonic Queue · Ordered Set
Last reported Apr 2026
Determine whether a string can become a palindrome by deleting at most one character: use a two-pointer scan from both ends and allow a single…
Companies: Meta, Microsoft
Last reported Apr 2026
Return the values visible when viewing a binary tree from its right side — i.e., the rightmost node at each depth, ordered top to bottom…
Companies: Meta
Last reported Apr 2026
Count the number of contiguous subarrays whose minimum equals minK and maximum equals maxK. The main challenge is to efficiently (O(n)) scan the array, partitioning…
Companies: Adobe, Uber
Array · Monotonic Queue · Queue · Sliding Window
Last reported Apr 2026
Design an event processor for an unbounded stream where each event has an id, timestamp, payload string, and checksum, with events potentially arriving out of…
Companies: Box
Last reported Apr 2026
Companies: Anthropic
Simulation & State Machines · Stacks & Queues
Last reported Apr 2026
Companies: OpenAI
Data Structure Design · Graphs
Last reported Apr 2026
Implement a leaky bucket rate limiter with a fixed drain rate and finite capacity, supporting a `try_acquire(n)` method that returns whether a request is allowed…
Companies: Box
Last reported Apr 2026
Find the length of the longest well-formed (balanced) parentheses substring in a string of '(' and ')', handling nested and adjacent valid segments; this typically…
Companies: Amazon, Meta, Microsoft, Uber
Bracket Sequences · Dynamic Programming · Stack · String
Last reported Apr 2026
Given n labeled nodes and a list of undirected edges, determine how many connected components the graph contains. This requires grouping nodes reachable from each…
Companies: Amazon, Uber
Last reported Apr 2026
Compute x raised to the integer power n (n may be negative and within 32-bit bounds), returning a double. The challenge is to handle negative…
Companies: Meta
Last reported Apr 2026
Companies: OpenAI
File & Media Storage · Key-Value Stores
Last reported Apr 2026
Given n cities and a list of undirected weighted connections, find the minimum total cost to connect all cities (or return -1 if it's impossible)…
Companies: LinkedIn, Meta
Last reported Apr 2026
Design algorithms to serialize a binary search tree into a compact string and deserialize it back to the exact original tree. Leverage the BST ordering…
Companies: LinkedIn, Microsoft
Last reported Apr 2026
Implement a BrowserHistory class that supports visiting URLs (which clears any forward history), moving back or forward up to a specified number of steps, and…
Companies: Amazon, Bloomberg, Chime
Array · Data Stream · Design · Doubly-Linked List
Last reported Apr 2026
Given a non-decreasing integer array that contains exactly one value occurring in more than 25% of elements, return that value. The sorted order lets you…
Companies: Meta
Last reported Apr 2026