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 76–100
Implement a thread-safe bounded FIFO queue with a fixed capacity that supports enqueue (blocks when full), dequeue (blocks when empty), and size operations. The core…
Companies: OpenAI
Last reported Oct 2026
Given 14 numbers, determine if it's a winning hand. A winning hand consists of a pair of identical numbers and the remaining 12 numbers can…
Companies: Google
Last reported Oct 2026
Implement algorithms to simulate and analyze the spread of disease through flowers arranged in a grid structure. Solve multiple related problems involving infection patterns…
Companies: OpenAI
Last reported Oct 2026
Decrypt a message that has been encrypted twice using two different letter substitution mappings applied in sequence. You must reverse both encryption layers to recover…
Companies: Upstart
Last reported Oct 2026
Parse each directory string to extract full file paths and their contents, then group paths by identical file content and return all groups containing at…
Companies: Anthropic, Google, OpenAI
Array · Hash Table · String
Last reported Oct 2026
Find duplicated files in a given directory. How to optimize? What if files changes? How to find duplicated files among many machines?
Companies: Anthropic, Snowflake
Last reported Oct 2026
Given a list representing a stack trace with functions and directional arrows ('->' for calls, '<-' for returns), determine which function is called the most…
Companies: Roblox
Last reported Oct 2026
Given a prebuilt environment, implement Python functions that apply a series of transformations to a set of images and write the results to an output…
Companies: Anthropic
Last reported Oct 2026
Design and implement a GET /api/bootstrap REST endpoint that accepts a user_id and aggregates data from multiple internal services (Consumer, Address, Payments) into a single…
Companies: DoorDash
Last reported Oct 2026
Implement a program that displays the last N lines of a given file. Pay attention to your buffering strategy and how you handle reading the…
Companies: Confluent
Last reported Oct 2026
Implement a Kac Ring data structure consisting of a circular ring of N positions, each with a color (0 or 1, or equivalently White/Black) and…
Companies: The Voleon Group, Voleon
Last reported Oct 2026
Implement an iterator that traverses IPv4 addresses starting from a given address, supporting forward iteration, reverse iteration, and CIDR block iteration.
Companies: Anthropic, OpenAI
Data Structure Design · Networking
Last reported Oct 2026
Find the length of the longest contiguous substring that contains no repeated characters. This is a classic sliding-window / two-pointer problem where you track seen…
Companies: Amazon, Apple, Autodesk, Bloomberg +12
Hash Table · Sliding Window · String
Last reported Oct 2026
Companies: Amazon, Apple, Meta
Binary Lifting · Binary Tree · Hash Table · Lowest Common Ancestor
Last reported Oct 2026
Design a stack data structure that supports standard push, pop, and top operations, along with a getMax operation that retrieves (but does not remove) the…
Companies: Confluent, Everpure, LinkedIn, Walmart Labs
Design · Doubly-Linked List · Linked List · Ordered Set
Last reported Oct 2026
Given an integer array nums and two integers k and m, perform at most k increment operations on any elements, then return the maximum possible…
Companies: Amazon
Array · Bit Manipulation · Greedy · Sorting
Last reported Oct 2026
Given non-overlapping segments where every integer position in [li, ri] holds ci coins, find the maximum total coins covered by any contiguous window of k…
Companies: Amazon
Array · Binary Search · Greedy · Prefix Sum
Last reported Oct 2026
Populate each node's next pointer to point to its immediate right neighbor on the same level (or NULL if none) in a binary tree that…
Companies: Crusoe, Meta
Last reported Oct 2026
Given arrays of box heights and warehouse room heights, maximize how many boxes can be placed knowing a box can only reach a room if…
Companies: Pinterest
Array · Greedy · Sorting
Last reported Oct 2026
Given box sizes and a sequence of warehouse slot heights, maximize how many boxes can be placed into the slots under the constraint that a…
Companies: Pinterest
Last reported Oct 2026
Given a list of words, design a class that can answer repeated queries returning the minimum index distance between two given words; optimize for many…
Companies: LinkedIn
Array · Design · Hash Table · String
Last reported Oct 2026
Given an array and window size k, return the median of each sliding window as it moves right by one. The core challenge is maintaining…
Companies: Meta, Microsoft, Spotify
Last reported Oct 2026
Implement a rate limiter using a sliding window algorithm that tracks and limits the number of requests allowed within a given time window. Extend the…
Companies: Adobe, Amazon, Cloudflare, CrowdStrike +4
Last reported Oct 2026
Given a BST and a value V, partition the tree into two BSTs where one contains all nodes with values ≤ V and the other…
Companies: Meta
Last reported Oct 2026
Count the number of contiguous subarrays of positive integers whose product is strictly less than k. Because all nums > 0, this is a sliding-window/two-pointer…
Companies: Apple
Array · Binary Search · Prefix Sum · Sliding Window
Last reported Oct 2026