Curated sets

Interview hard

Hard rounds and final-stage questions.

All problems
Total results39 problems
TopicsJudge
Paper RouteWith N+1 nodes and exactly N roads, find the cheapest closed walk from node 0 covering all addresses, then add the campus travel cost from wherever you end.Hard8GraphDFS+2No attempts yet1s128 MBJudgeable
A Brief GerrymanderChoose A avenue boundaries including 1 and 100 to maximize the number of vertical strips that contain at least one marked neighborhood, given fixed street boundaries.Hard8Dynamic programmingSorting+1No attempts yet1s128 MBJudgeable
Spare the Ewoks!Given an m by n grid with blocked cells, choose up to three non-overlapping axis-aligned rectangles to maximize the total covered area.Hard8Dynamic programmingPrefix sum+1No attempts yet3s128 MBJudgeable
Repair DepotsPlace at most c depots anywhere in the plane to minimize the largest distance from any of n bots (n at most 16) to its nearest depot, and print that distance to six decimals.Hard8Binary searchGeometry+2No attempts yet1s128 MBJudgeable
Quick SearchGiven a small graph and k officers all starting at A, find the minimum time for the officers to jointly visit every node, where each officer walks a path.Hard8GraphDynamic programming+1No attempts yet1s128 MBJudgeable
The DoorsGiven up to 18 vertical walls, each with two doorways, find the shortest path from (0,5) to (10,5) inside a 10x10 square without crossing any solid segment.Hard8GeometryGraph+2No attempts yet1s128 MBJudgeable
Game of StonesGiven a directed acyclic graph with stones on nodes, two players alternately slide one stone along an edge; decide whether the first player wins.Hard8Game theoryGraph+2No attempts yet1s128 MBJudgeable
Escaping the Tutoring HouseFind whether a tutor can reach the exit while keeping all kids inside a forward half-plane at every instant, and if so, the shortest such path.Hard8GeometryGraph+2No attempts yet1s128 MBJudgeable
ClockFind the largest empty circle fully inside a rectangular wall that avoids up to 50 non-overlapping discs, using a generalized Voronoi diagram of points, segments, and circles.Hard8GeometryDivide and conquer+2No attempts yet1s128 MBJudgeable
The Pharaoh's CurseOn a small grid, S pushes up to two sarcophagi onto buttons while stepping around them, and must reach the exit with all buttons held; find the minimum steps or report impossible.Hard8BFSGraph+2No attempts yet5s128 MBJudgeable
Fat NinjasGiven point sensors in an N by N square, find the diameter of the largest circle that can travel from the left side to the right side without touching any sensor.Hard8GeometryUnion-find+2No attempts yet3s128 MBJudgeable
StarCowraftGiven test battle outcomes and the constraint that no unit strength exceeds 100 times another, determine for each new battle whether one army must win or the result is undecidable.Hard8GeometryMath+2No attempts yet1s128 MBJudgeable
Doing WindowsGiven a screen and four windows with fixed aspect ratios, decide whether the windows can be resized and placed to tile the screen with no gaps or overlaps.Hard8GeometryMath+2No attempts yet1s128 MBJudgeable
CensorshipGiven a text and a filter word set, remove occurrences repeatedly to make the shortest possible result and report its length.Hard8Dynamic programmingString+1No attempts yet1s128 MBJudgeable
One-Way RoadsDecide whether the undirected streets of a graph can all be oriented so that each required ordered pair stays reachable from the first to the second.Hard8GraphDFS+2No attempts yet2s64 MBJudgeable
Prison rearrangementGiven a bipartite conflict graph between two prisons of size m, find the largest k <= m/2 so that k prisoners can be swapped across while keeping every conflicting pair apart.Hard8GraphBFS+2No attempts yet1s128 MBJudgeable
IslandGiven all pairwise shortest tolls among the n seaside triangles, recover the adjacency structure and edge weights of the underlying border tree.Hard8TreeDFS+2No attempts yet1s128 MBJudgeable
SchoolsAssign a distinct number 1..n to each school within its allowed interval, minimizing the total weighted movement cost.Hard8GreedyDynamic programming+2No attempts yet3s128 MBJudgeable
PlotPartition a sequence of n points into at most m contiguous groups, replacing each group with one point, to minimize the maximum distance from any original point to its group's representative.Hard8Binary searchDynamic programming+2No attempts yet30s128 MBJudgeable
Finding an integerFind the smallest integer at least N whose decimal digits contain d1 at least c1 times and d2 at least c2 times.Hard8GreedyImplementation+2No attempts yet2s512 MBJudgeable
Laser TowersOn a grid with directional laser towers and enemy counts, choose which towers fire and at which cell so lasers never intersect, maximizing enemies destroyed.Hard8GreedyBrute force+2No attempts yet2s512 MBJudgeable
Substitution Cipher KeyGiven N distinct words and a target permutation, find the lexicographically smallest substitution cipher key that sorts the encrypted words into that order, or report none.Hard8GreedySorting+2No attempts yet1s64 MBJudgeable
Feasible roundingRound each decimal entry to floor or ceiling so that every row and column sum still matches its stated total, choosing the lexicographically smallest whole table.Hard8GreedyMatrix+2No attempts yet1s512 MBJudgeable
Tire PatchesOn a circular tire, cover all hole positions with the minimum total length of uncut patches of two given lengths and return that total length.Hard8Dynamic programmingArray+2No attempts yet2s512 MBJudgeable
War Among the StarsCompute the shortest distance between two tetrahedra in space, given the coordinates of their eight vertices.Hard8GeometryImplementation+1No attempts yet2s512 MBJudgeable
Palindrome cipher decryptionFor each string, find its longest palindromic subsequence and output the lexicographically smallest one among those of maximal length.Hard8Dynamic programmingString+2No attempts yet8s512 MBJudgeable
Splitting Game LevelsPartition n levels into k consecutive groups to minimize the expected total time of a random coin-draw process, and print it to six decimals.Hard8Dynamic programmingDivide and conquer+2No attempts yet2s512 MBJudgeable
Wolves 2Count binary strings of length N in which every given interval contains at most two ones, modulo 1e9+7.Hard8Dynamic programmingPrefix sum+2No attempts yet2s512 MBJudgeable
I Teach SweepingGiven segments in the first quadrant, find a line through the origin that intersects the most segments and report that count.Hard8GeometrySorting+1No attempts yet2s512 MBJudgeable
Company Culture 4On a rooted tree, praise spreads downward from an employee to all descendants or upward to all ancestors, the direction flips over time, and queries ask for an employee's accumulated praise.Hard8TreePrefix sum+2No attempts yet2s512 MBJudgeable
Imbalance ObviationAssign each marble L or R so the pan difference stays within 1 during insertion in order and during a given removal permutation; output the lexicographically smallest assignment.Hard8GreedyImplementation+2No attempts yet20s1024 MBJudgeable
Monday BluesGiven an N by M grid with costly buildable cells and blocked or unbuildable cells, find the minimum total cost to cut every path from (1,1) to (N,M), or report that no placement can do it.Hard8GraphMinimum spanning tree+2No attempts yet1s512 MBJudgeable
Alien microbesCount the breeding patterns over H days starting from one microbe, where each day the microbes alive produce children with a total of at most W.Hard8Dynamic programmingCombinatorics+2No attempts yet2s256 MBJudgeable
Shooting GalleryA row of ducks, each with a species; a good round hits two ducks of the same species and keeps only the ducks strictly between them, and rounds continue while same-species pairs remain. Find the longest possible run of good rounds.Hard8Dynamic programmingArray+2No attempts yet2s512 MBJudgeable
SumdokuFill a 9x9 Sudoku grid so that constrained adjacent cells inside each 3x3 block satisfy <, =, or > versus 10, and print the lexicographically smallest solution.Hard8BacktrackingImplementation+1No attempts yet2s512 MBJudgeable
Ladder ManipulationGiven a ladder with N vertical lines, H rows, and M existing rungs, find the minimum number of rungs to add so every walk from column i ends at column i, or report -1 if more than 3.Hard8BacktrackingBrute force+2No attempts yet2s512 MBJudgeable
Snow BootsFor each of B boots with limits on snow depth and step length, decide whether the farmer can walk from tile 1 to tile N, landing only on tiles whose snow is shallow enough.Hard8Binary searchSorting+2No attempts yet2s512 MBJudgeable
XEN 3166Assign each country a length-K subsequence starting with its first letter so that code order matches name lexicographic order, or report impossible.Hard8GreedyString+1No attempts yet2s512 MBJudgeable
CitationsOrder the reading of a citation tree rooted at book 1 so that the sum of all book return times is minimized.Hard8TreeGreedy+2No attempts yet1s1024 MBJudgeable