Word break II: every way to split a sentenceCodingGiven a string s and a list of dictionary words, insert spaces into s so that every piece is a dictionary word. Return every sentence you can make this way.
Last asked Dec 2026
Weighted cache that evicts the heaviest entriesCodingImplement WeightedCache, a key-value cache with a total-weight budget instead of an item count. Each entry has a positive integer weight.
Accounts merge: group accounts that share any attributeCodingYou get records [account, attribute]: an attribute is something like a phone number, an email or a device id. Two accounts that share any attribute belong to the same person, and…
Add one delivery center to minimize the worst distanceCodingA grid marks delivery centers with 1 and ordinary locations with 0. The distance between two cells is max(|r1 - r2|, |c1 - c2|), so moving diagonally counts as one step.
Debug missing and extra results in a Django movie search APICodingA Django movie database returns wrong search results: some movies that should match are missing and some that shouldn't are returned. Earlier digging pointed at the api/search…
Course schedule: finish every course and find an orderCodingYou have n courses, numbered 0 to n - 1, and a list of prerequisite pairs [a, b] meaning course b must be taken before course a. First decide whether every course can be…
Last asked Nov 2026
+2
Best time to buy and sell stockCodingGiven a list of daily prices for one asset, return the most profit you can make. First allow any number of buy-then-sell trades, holding at most one share at a time.
Fewest road reversals in a directed networkCodingA road network has n cities and one-way roads. You may drive a road against its direction, but each time you do it counts as one violation.
Last asked Nov 2026
+1
Friend recommendation by mutual friendsCodingGiven a social graph where friendship goes both ways, recommend people a user might know: people who are not already their friends, ranked by how many friends they share with the…
Dot product of run-length encoded vectorsCodingVery long integer vectors contain long runs of repeated values. Design a compact representation that stores each run as a value and a length, and compute the dot product of two…
Last asked Nov 2026
Sliding-window attention in C++ with a KV cache you designCodingYou are dropped into an existing C++ inference codebase and have 30 minutes to add sliding-window attention: a token attends to the latest W positions only, not to everything…
Route requests to the nearest healthy data centerCodingBuild an in-memory router that sends each client request to a nearby data center. The exercise comes in parts, each building on the last, so earlier operations must keep working.
Range sum query 2D (immutable)CodingAn m x n matrix of integers is fixed. Many queries follow; each one names a rectangle by two cells, its upper-left and lower-right corners, and wants the sum of all cells inside…
Last asked Nov 2026
Mean IoU of matched bounding boxes with unordered cornersCodingA detector predicts axis-aligned boxes, and each prediction is already paired with its ground-truth box. Score a pair by intersection over union (IoU): the area the two boxes…
Binary tree right side viewCodingReturn the values you would see looking at a binary tree from its right side: the last node of each level, from top to bottom.
Convert a sorted linked list to a height-balanced BSTCodingYou get the head of a singly linked list whose values are in strictly increasing order. Build a binary search tree holding exactly those values that is height-balanced: at every…
Settle group debts with the fewest transfersCodingA group of friends shared costs, and the record of who owes whom is a list of debts (debtor, creditor, amount). Return the smallest number of money transfers that settles every…
Last asked Nov 2026
+1
Serialize and deserialize a binary treeCodingWrite two functions for a binary tree of integer values: encode turns a tree into a string, and decode rebuilds a tree with exactly the same structure and values from that…
Stack with constant-time minimumCodingDesign a stack that, besides the usual operations, returns its smallest element, with every operation in constant time.
Jump game: can you reach the last index?CodingYou get a list of non-negative integers and start at index 0. nums[i] is the longest jump you may make from index i: you can move forward to any index from i + 1 up to i +…
Last asked Nov 2026
+4
Basic calculator II: evaluate + - * / without parenthesesCodingEvaluate a string expression of non-negative integers, the operators +, -, and /, and spaces. There are no parentheses. and / bind tighter than + and -, and division truncates…
Last asked Nov 2026
Count legal tic-tac-toe game sequencesCodingCount how many different tic-tac-toe games can be played. A game is the ordered list of moves from the board you start on to the end: X and O alternate, and play stops the moment…
Reported by 2 members · Last asked Nov 2026
Key-value store on a block device with 8-character blocksCodingYou get a small project with a block device already written and a KVStore class to finish so the unit tests pass. Keys may live in memory, but every value must be stored on the…
Reported by 1 member · Last asked Nov 2026
Recipe shopping cart with bulk discountsCodingA cooking app lets people put whole recipes in a shopping cart. The store runs bulk discounts on single ingredients: buy enough of one ingredient across the recipes in your cart…
Reported by 1 member · Last asked Nov 2026
+4
Word search with a word search II follow-upCodingYou get an m x n grid of lowercase letters. A word can be traced if a path of cells spells it in order, where each cell shares an edge with the previous one and no cell is used…
Flood fill: recolor a connected region of an imageCodingAn image is a grid of integer colors. Given a starting pixel (sr, sc) and a new_color, recolor the starting pixel and every pixel connected to it through up, down, left or right…
Last asked Nov 2026
+1
Merge k sorted listsCodingYou get k singly linked lists, each sorted in ascending order. Merge them into one sorted linked list and return its head, reusing the existing nodes.
Last asked Nov 2026
Agentic RAG take-home projectCodingA take-home: build an agentic retrieval-augmented pipeline. A model with a search tool must answer questions over a document set, including questions that need more than one…
Last asked Nov 2026
+5
Top K frequent elementsCodingGiven an integer array and k, return the k values that occur most often. Order them by count, highest first; break ties by the smaller value.
Find the second-largest distinct value in an arrayCodingGiven a list of integers that may contain repeats, return the second-largest distinct value: the largest value that is strictly smaller than the maximum. If the list has fewer…
Review a series of pull requestsCodingYou are shown two or three pull requests, one after another, each harder than the last, in Python or Java. Review each as you would at work: read it, then type the comments you…
Last asked Nov 2026
Entropy from logits, stable and then streamingCodingCompute the entropy, in nats, of the distribution softmax(logits) for a vector of logits, without overflow or underflow even for very large or very negative logits. Then the…
String compression and decompressionCodingWrite a pair of functions that compress a string with run-length encoding and decompress it back exactly. Each run of a repeated character becomes the character followed by the…
Last asked Nov 2026
Four in a row: check a winning moveCodingTwo players, "a" and "b", play on a rectangular grid. board is a 2D list of strings; each cell is "a", "b", or "" (empty). move = (row, col) is the cell where player places a…
Last asked Nov 2026
Concurrent Python CLI that queries a local serviceCodingWrite a Python command-line tool that takes a list of serial numbers, asks a service running locally over HTTP about each one, and reports the results. Build it in three steps.
Last asked Nov 2026
Verify an AI-written feature in a large unfamiliar repositoryCodingYou are working in a large repository you have never seen, with an AI coding assistant. The assistant has implemented the feature you were asked for, and the package it touched…
Expand placeholders from a variable storeCodingImplement a small store of variables with template substitution, as in a shell startup file where export NAME="Tom" defines a variable. Any string can refer to a variable as…
Last asked Nov 2026
Assign cookies to satisfy the most childrenCodingEvery child has a smallest cookie size they will accept, and every cookie has a size. A child is satisfied by getting one cookie at least that big.
Last asked Nov 2026
Maximum root-to-leaf path sum in a binary treeCodingGiven a non-empty binary tree whose nodes hold numbers, return the largest sum of values along a path that starts at the root and ends at a leaf (a node with no children). Values…
Group piano notes into hand positions and assign fingersCodingA melody is a list of integer notes played in order with one hand; neighbouring integers are neighbouring keys. A hand position covers five neighbouring keys, so one position can…
Resumable iterators that save and restore their positionCodingDesign an iterator that can save its position as a small, portable checkpoint and later be rebuilt from it, even in a new process, so iteration continues exactly where it…
Replay recorded API requests that carry generated IDsCodingYou get a repository with a recording of API requests and a partly working tool that replays them, in order, against a running server (Python, FastAPI, pytest). Repair and finish…
Explore and clean undocumented 2D image arrays in NumPyCodingYou are handed several 2D NumPy arrays with almost no explanation, for a team that works with image data. First work out what they hold by inspecting and plotting them as images…
Shortest distance from all buildingsCodingYou get an m x n grid where 0 is empty land, 1 is a building and 2 is an obstacle. You want to build a house on an empty cell so that the sum of its shortest walking distances to…
Last asked Nov 2026
Citation tagging over generated textCodingA model wrote a sentence, and you have a list of source phrases that may appear in it. Return the sentence with every place a source phrase appears wrapped in <yellow> and…
Paged KV cache in C++: implement access, then optimize itCodingDuring generation a transformer saves each processed token's attention keys and values, so they are not recomputed. A paged KV cache stores them in fixed-size pages taken from a…
Last asked Nov 2026
Bus routes: fewest buses between two stopsCodingEach bus route is a list of stops, and a bus on a route can take you between any two of its stops. You can change buses at any stop two routes share.
Build a transaction rule engine with an AI assistantCodingIn an editor with a built-in AI coding assistant, implement a rule engine that decides whether each payment transaction is accepted or blocked. The task grows in parts, and few…
Last asked Nov 2026
Key-value cache with per-entry TTLCodingImplement an in-memory key-value cache where every write gives a key, a value and a time-to-live. Once an entry's time is up it must behave as if it was never written.