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 101–125
Given a binary tree whose nodes are digits 0–9, compute the sum of all integers formed by concatenating digits along each root-to-leaf path (e.g., 1→2→3…
Companies: Meta
Last reported Oct 2026
Implement a thread-safe `BankingServiceImpl` class that satisfies a `BankingService` interface with deposit and withdraw operations backed by a `ConcurrentHashMap` repository…
Companies: Okta
Last reported Oct 2026
Given an integer array and k, return the k most frequent elements — the core challenge is to count element frequencies and extract the top-k…
Companies: Amazon, Bloomberg, Google, Meta +9
Array · Bucket Sort · Counting · Divide and Conquer
Last reported Oct 2026
Given an array of non-negative heights representing elevation bars of width 1, compute the total units of water that can be trapped between them after…
Companies: Amazon, Bloomberg, Goldman Sachs, Google +6
Array · Dynamic Programming · Monotonic Stack · Stack
Last reported Oct 2026
Simulate the Unix cd command by implementing path resolution for relative paths ('.' and '..'), absolute paths, and symbolic links while detecting potential cycles. Use…
Companies: Meta, OpenAI
Last reported Oct 2026
Given an array of daily stock prices, compute the maximum profit achievable from exactly one buy-before-sell transaction (i.e., the largest prices[j] - prices[i] with j…
Companies: Adobe, Amazon, Apple, Atlassian +10
Array · Dynamic Programming
Last reported Sep 2026
Given a binary array representing a flowerbed (0 = empty, 1 = planted) with no adjacent 1s, determine if you can add n new flowers…
Companies: LinkedIn, Meta
Array · Greedy
Last reported Sep 2026
Design a VM manager class with methods to start a VM, stop a VM, and calculate a user's total expenditure across all their VMs. Billing…
Companies: Nebius
Last reported Sep 2026
Given a list of hotel reservations with check-in and check-out days, compute the number of active reservations per day and identify anomalous days where the…
Companies: Booking.com
Last reported Sep 2026
Given a string of well-formed nested brackets and characters, return all substrings or characters enclosed within the innermost nested brackets. Note that there may be…
Companies: Bloomberg
Last reported Sep 2026
Given an array of integers (possibly unsorted and with duplicates), identify all maximal sequences of consecutive numbers and return each range as its start and…
Companies: Nebius
Last reported Sep 2026
Design and implement an inverted index data structure that maps each unique word to a list of documents or positions where it appears. The solution…
Companies: Confluent, Datadog
Last reported Sep 2026
Implement two functions, `registerHandler(pattern)` and `getHandler(path)`, that form the core routing logic of a web framework. `registerHandler` adds URL patterns (which may…
Companies: Google
Last reported Sep 2026
Implement an encoding algorithm that combines Run Length Encoding (RLE) and Bit Packing (BP). RLE encodes consecutive identical elements as RLE[element, frequency] and is…
Companies: Databricks
Last reported Sep 2026
Design a data structure supporting insert(val), remove(val), and getRandom() — which returns a uniformly random existing element — with each operation in average O(1) time…
Companies: Amazon, Apple, Bloomberg, Citadel +7
Array · Design · Hash Table · Math
Last reported Sep 2026
Implement a key-value store that supports standard get and put operations while also tracking the average latency or call count for each operation type.
Companies: Databricks
Last reported Sep 2026
Implement a logger that decides whether to print a message at a given timestamp: return true if the message hasn't been printed in the last…
Companies: Amazon, Bloomberg, Google, Microsoft +3
Data Stream · Design · Hash Table
Last reported Sep 2026
Given a binary tree and two nodes p and q, find their lowest common ancestor (LCA) — the deepest node that has both p and…
Companies: Amazon, Apple, Atlassian, Canva +6
Binary Lifting · Binary Tree · Depth-First Search · Lowest Common Ancestor
Last reported Sep 2026
Write a program that matches incoming payments to their corresponding open invoices based on the payment memo line. The system should handle cases where standalone…
Companies: Stripe
Last reported Sep 2026
Find the maximum length of a contiguous subarray that can be made all 1s by flipping at most k zeros — equivalently, find the longest…
Companies: Amazon, D. E. Shaw, LinkedIn, Meta
Array · Binary Search · Prefix Sum · Sliding Window
Last reported Sep 2026
Starting from given initial boxes, repeatedly open any box that is either already open or for which you have a key to collect its candies…
Companies: Airbnb
Array · Breadth-First Search · Graph Theory
Last reported Sep 2026
Place n queens on an n×n chessboard so no two queens share a row, column, or diagonal, and return all distinct board configurations. This is…
Companies: Microsoft, Netapp
Algorithm X · Array · Backtracking
Last reported Sep 2026
Given a black-box API hasShips(topRight, bottomLeft) that returns whether at least one ship (point at integer coordinates) lies inside an axis-aligned rectangle, compute the…
Companies: Bloomberg
Last reported Sep 2026
Given a lowercase string, repeatedly remove any two equal adjacent characters until no more removals are possible and return the resulting (unique) string. Solve in…
Companies: Goldman Sachs, Meta, Whatnot
Last reported Sep 2026
Given a string s and integer k, repeatedly remove any run of k equal adjacent characters until no more removals are possible and return the…
Companies: Amazon, Apple, Meta, Oracle +2
Stack · String
Last reported Sep 2026