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 326–350
Implement a parser that first reads atoms, then flat lists, and then nested lists. Read characters from left to right without splitting the whole input…
Companies: Baseten
Input Validation · Parsing · Stacks
Last reported Aug 2026
Given a 2D grid representing a map of land and water cells, count the number of distinct lakes (connected regions of water cells). A lake…
Companies: Google
Last reported Jul 2026
Given bombs as circles (xi, yi, ri), form a directed graph where there is an edge i→j if bomb j's center lies within bomb i's…
Companies: Airbnb
Last reported Jul 2026
Count the number of index pairs (i<j) for which the absolute sum/difference of the pair satisfies both min(|a−b|,|a+b|) ≤ min(|a|,|b|) and max(|a−b|,|a+b|) ≥ max(|a|,|b|). The…
Companies: Meta
Last reported Jul 2026
Given two sorted arrays representing the face values of two fair dice A and B, calculate the probability that a single roll of die A…
Companies: Google
Last reported Jul 2026
Given axis-aligned squares (overlaps counted once), find the minimum y-coordinate of a horizontal line that splits the union area into equal halves. The core challenge…
Companies: Google
Last reported Jul 2026
Implement a string substitution system that replaces placeholders (formatted as %var% or similar) in a text string with corresponding values from a given mapping. The…
Companies: Google
Last reported Jul 2026
Given two strings of 'L', 'R', and 'X', determine if start can be transformed into result by repeatedly applying moves "XL" → "LX" (L moves…
Companies: Google
Last reported Jul 2026
Implement a thread-safe fund transfer system between accounts using Java and PostgreSQL. Focus on transaction handling and data consistency for concurrent transfers, proper…
Companies: Revolut
Last reported Jul 2026
Companies: Amazon, LinkedIn, Microsoft
Last reported Jul 2026
Given a sorted array of distinct integers and inclusive lower/upper bounds, find all numbers or continuous ranges within [lower, upper] that are not present in…
Companies: Google, Meta
Last reported Jul 2026
Each node of the tree represents a real machine in a cluster. Each machine in the cluster can only communicate with its parent and child…
Companies: OpenAI
Last reported Jul 2026
Determine whether a target word can be formed by a path of horizontally or vertically adjacent cells in an m×n letter grid without reusing a…
Companies: Amazon, Glean, Google, Grammarly +3
Array · Backtracking · Depth-First Search · Matrix
Last reported Jul 2026
Design a data structure to track chunk acknowledgments for a large file being uploaded in sequentially numbered, potentially out-of-order chunks. The structure must support…
Companies: Google
Last reported Jul 2026
Choose an integer x in [0, 2^n) to maximize (a XOR x) * (b XOR x) (answer mod 1e9+7); the core challenge is picking x’s…
Companies: Atlassian, Cisco, Zomato
Bit Manipulation · Greedy · Math
Last reported Jul 2026
Determine if a set of equations like "a==b" and "a!=b" over single-letter variables is satisfiable by grouping variables connected by equalities (e.g., with union-find) and…
Companies: Amazon
Last reported Jul 2026
Parse and evaluate a fully parenthesized boolean expression string made of literals 't'/'f', unary '!' and comma-separated n-ary '&' and '|' operators with arbitrary nesting…
Companies: Microsoft
Last reported Jul 2026
Given a sorted (ascending) array of unique integers and a target value, return the index of the target or -1 if not present; the solution…
Companies: Amazon, Bloomberg, Google, Meta +1
Array · Binary Search
Last reported Jul 2026
Design and implement a user interface for a card game that includes functionality for dealing cards. Discuss the architecture, user interactions, and any animations or…
Companies: Airbnb, Apple
Last reported Jul 2026
Given a win condition and predefined game interfaces, implement a fully functional Rock Paper Scissors game. The solution should correctly handle game logic and player…
Companies: Apple
Last reported Jul 2026
Design a data structure that supports booking half-open intervals [start, end) so that book(start, end) returns true and inserts the interval only if it causes…
Companies: Amazon, Google
Last reported Jul 2026
Given an immutable integer array, implement a NumArray that returns the sum of elements in any [left, right] range. Because the array is static and…
Companies: Uber
Last reported Jul 2026
Given a set of weighted intervals, pick at most two non-overlapping events (events are inclusive, so the next must start at least end+1) to maximize…
Companies: Goldman Sachs, Grammarly
Array · Binary Search · Dynamic Programming · Heap (Priority Queue)
Last reported Jul 2026
Find the minimum number of steps from the top-left to bottom-right in a 4-directional binary grid if you may remove up to k obstacles; treat…
Companies: Amazon, Cisco, D. E. Shaw, Databricks +2
Array · Breadth-First Search · Matrix
Last reported Jul 2026
Given a buggy NumPy-based neural network notebook for MNIST digit classification, identify and fix issues such as softmax overflow and incorrect gradient backpropagation using…
Companies: Datology
Last reported Jul 2026