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 2,051–2,075
Find all employees whose salary is among the top three distinct salaries in their department and return their department name, employee name, and salary. Include…
Companies: Intuit
Database
Given a sequence of distinct keys inserted into an empty binary search tree, compute the final tree's maximum depth (height). The challenge is to determine…
General practice
Given half-open colored segments that overlap and mix (where a mixed color is the set-sum of active colors), produce the minimal list of non-overlapping half-open…
General practice
Design a mutable 3D binary matrix that supports point updates and layer- or axis-aligned queries (e.g., count of 1s in a given 2D layer or…
General practice
Design a data structure to organize stock data and retrieve it based on stock name or stock name and date in ascending order of date.
General practice
Design and implement the APIs for a file-sharing system that manages files, users, ownership and access permissions (e.g., upload, share, revoke, query). The core challenge…
General practice
Design a data structure that supports assigning/replacing a number at any index and returning the smallest index that currently contains a given number (or -1…
General practice
Design a data structure that maintains a dynamic array and supports efficient updates (insert/update/delete) while answering online statistical queries such as mean, median…
General practice
Design an ATM with five fixed denominations (20, 50, 100, 200, 500) that supports depositing counts of each bill and withdrawing a given amount. For…
General practice
Construct an expression tree from a sequence of tokens (operators and operands) where internal nodes are operators and leaves are numbers or variables, and implement…
General practice
Design an in-memory file system that supports mkdir, ls, addContentToFile, and readContentFromFile Serialize and deserialize a binary tree Design Netflix's video streaming service
Companies: Netflix
Companies: OpenAI
Companies: CrowdStrike, Google
Design · Hash Table · Heap (Priority Queue) · Ordered Set
Design a Bitset class supporting fix, unfix, flip, all, one, count, and toString on a fixed-size bit array. The key challenge is to implement flip…
General practice
Run a generator that yields promises and return [cancel, promise] where each yielded promise's resolution or rejection is passed back into the generator via next/throw…
General practice
Implement a fixed-capacity circular double-ended queue that supports O(1) insertions and deletions at both front and rear, plus front/rear access and isEmpty/isFull checks…
General practice
Implement a fixed-size circular queue (ring buffer) supporting enqueue, dequeue, Front/Rear, isEmpty and isFull operations without using built-in queue types. The core…
Companies: NVIDIA
Array · Design · Linked List · Queue
Implement an iterator over a run-length–encoded string that supports next() and hasNext(); the challenge is to parse counts (possibly multi-digit) and return characters lazily…
General practice
Companies: Goldman Sachs
Array · Design · Hash Table · Heap (Priority Queue)
Companies: Amazon, Meesho
Array · Binary Search · Design · Prefix Sum
Design a data structure that supports push and pop at the front, middle, and back of a sequence (when length is even, the middle is…
General practice
Design a class for a directed, positive-weighted graph that supports adding edges and answering shortest-path-cost queries between any two nodes. With n ≤ 100 and…
General practice
Implement a HashSet from scratch supporting add(key), remove(key), and contains(key) without using built-in hash table libraries. Keys are integers in [0, 10^6] with up to…
General practice