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 701–725
Given a 4-digit combination lock starting at '0000', find the minimum number of single-digit rotations needed to reach a target combination while avoiding forbidden deadend…
Companies: Brex, Meta
Last reported Mar 2026
Companies: OpenAI
Data Structure Design · Simulation & State Machines
Last reported Mar 2026
Given a list of words where players alternate picking unused words that start with the last letter of the previous word, determine whether the first…
Companies: Dropbox
Last reported Mar 2026
Companies: OpenAI
Data Structure Design · Heaps & Priority Queues
Last reported Mar 2026
Given an array or data structure, remove duplicate elements while maintaining the original order of first occurrences of the remaining unique elements. Implement an efficient…
Companies: Google, Meta, Palo Alto Networks
Last reported Mar 2026
Given a sorted array where every element appears exactly twice except for one that appears once, find that single element in O(log n) time and…
Companies: Palo Alto Networks
Last reported Mar 2026
Return the node values grouped by tree depth, but alternate the order of values on each level (left-to-right then right-to-left, and so on). This is…
Companies: LinkedIn, Meta
Last reported Mar 2026
Produce the level-by-level ordering of a binary tree's node values but return the levels from bottom to top (leaf level first, root last), preserving left-to-right…
Companies: Meta
Last reported Mar 2026
Design a job management system using a priority queue that supports enqueueing jobs and retrieving batches of highest priority jobs. Each job contains an ID…
Companies: Microsoft
Last reported Mar 2026
Given directed edges that form a single non-cyclic path, find the unique city with outdegree zero — the destination. Practically, it's the city that appears…
Companies: Bnsf
Last reported Mar 2026
Implement an iterator over a run-length encoded sequence represented as an array of (count, value) pairs. Support a next(n) operation that exhausts the next n…
Companies: Google
Last reported Mar 2026
Given an array of integers, find and return the second largest element. For example, given [1, 2, 3, 4, 5], the expected output is 4.
Companies: Goldman Sachs
Last reported Mar 2026
Given two JSON values, determine if they are deeply equal by recursively checking that primitives match, arrays have equal elements in the same order, and…
Companies: Amazon
Last reported Mar 2026
Find the minimum cost to go from start to target in a 2D grid where moving anywhere costs Manhattan distance but there are directed "special…
Companies: Goldman Sachs, Google
Last reported Mar 2026
Companies: Anthropic
Concurrency · File & Media Storage
Last reported Mar 2026
Solve variations of the classic 0/1 knapsack problem, such as when profits are binary (1 or 2) or when weights are fractional (up to 2…
Companies: Google
Last reported Mar 2026
Companies: Stripe
Last reported Mar 2026
Companies: Meta
Last reported Mar 2026
Given arrays fruits and baskets of equal length, simulate placing each fruit type in order into the leftmost unused basket with capacity >= the fruit…
Companies: Tala
Last reported Mar 2026
Companies: OpenAI
Data Structure Design
Last reported Mar 2026
Given strings S and T, find the shortest contiguous substring of S such that T appears as a subsequence (characters of T appear in order…
Companies: LinkedIn
Last reported Mar 2026
Write a function that reads a binary file containing a fixed-length header followed by data records. Parse the header to determine metadata such as the…
Companies: Apple
Last reported Mar 2026