Curated sets
Interview core
The mediums that show up in real onsite loops.
Total results1,547 problems
| Topics | Judge | |||||
|---|---|---|---|---|---|---|
| Word SearchGiven N database words compared in order against a query using character-by-character matching that also checks for word-end, compute total comparisons per query. | Medium5 | TrieString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Concert Rest ScheduleSchedule N members' fixed-length rest intervals within a T-minute concert so that at most two intervals overlap at any moment. | Medium5 | GreedyIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Counting Axis-Aligned Right TrianglesCount triangles among N points where the right angle vertex has one point sharing its x-coordinate and another sharing its y-coordinate. | Medium5 | Hash mapMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TennisValidate whether recorded tennis set scores form a legal best-of-three match, with a special rule that one named player never loses a set. | Medium5 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Non-Intersecting CirclesGiven N circles centered on the x-axis, find the minimum number to remove so no two remaining circles overlap, essentially an interval scheduling problem. | Medium5 | GreedyIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Beacon NetworkSimulate beacons that light up over time and archers who shoot arrows down a fixed priority list toward unlit targets, computing each beacon's lighting time. | Medium5 | SimulationHeap+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Sangbeom's Secret MessageGiven a Vigenere-style encrypted message and a known substring of the plaintext, deduce the repeating key and decrypt the full message. | Medium5 | StringBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Sidewalk PillarsGiven a sidewalk string and up to N extra pillars, place pillars in free segments to minimize the count of length-L parking spots, breaking ties by using fewest pillars. | Medium5 | GreedyString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Tomo's CalculatorGiven a calculator that repeatedly multiplies by B starting from A*B, find how many presses of '=' are needed until the displayed number ends with a given suffix C, or report impossible. | Medium5 | MathSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cinema InvitationGiven each friend's minimum required number of other attending friends, find the smallest subset size satisfying everyone invited's threshold. | Medium5 | GreedySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Restoring a Scrambled EmailGiven a scrambled string formed by replacing '@' with 'at' and optionally inserting 'nospam' once, output all distinct valid email addresses that could produce it. | Medium5 | StringBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| JANICAReconstruct running leader times from cumulative differences over two ski rounds to find the top three finishers by total time. | Medium5 | SimulationSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TramFind the minimum number of switch changes needed to travel from intersection A to B in a directed graph where each node's first listed edge is free and others cost 1, using shortest-path with 0/1 edge weights. | Medium5 | Shortest pathGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 21 Rolls of GimbapSimulate a Connect Four style game on a 6x7 board from 21 alternating moves and report who first got four in a row and on which of their throws. | Medium5 | SimulationMatrix+1 | No attempts yet | 1s | 128 MB | Judgeable |
| AirplaneSimulate passengers walking down a single aisle to their assigned row and taking 5 seconds to load luggage, blocked by others ahead, to find total boarding time. | Medium5 | SimulationQueue+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Foot TypingGiven two words and their interleaving, output the lexicographically smallest sequence of 1s and 2s marking which word produced each character. | Medium5 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| CardsSimulate a card-sorting game to find which numbers remain consistent with a sequence of column answers after repeated row/column reshuffling. | Medium5 | SimulationMath | No attempts yet | 1s | 128 MB | Judgeable |
| T9Simulate a T9 keypad predictor that maps key-press sequences to dictionary words, splitting on key 1 as space and marking unmatched words with asterisks. | Medium5 | StringHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Popularity ListReconstruct the lexicographically smallest previous week's ranking consistent with UP/DOWN/SAME movement marks of this week's list. | Medium5 | GreedyArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| PINCount pairs of 4-character PINs (from a given list) that differ in exactly D of their four positions. | Medium5 | Hash mapCombinatorics+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Matching BinsGiven a sequence of bin sizes, find the largest K such that the first K bins can each be matched to a distinct larger bin among the following K bins. | Medium5 | Binary searchGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| CoinDetermine the fake coin among 12 and whether it is heavier or lighter, given three balance weighing results, or report impossible/indefinite. | Medium5 | Brute forceSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| LinkerGiven modules with export/import tables and an entry symbol, find the reachable non-redundant modules, duplicate exports used by them, and unresolved imports. | Medium5 | GraphBFS+1 | No attempts yet | 1s | 128 MB | Judgeable |
| GemsGiven a tree, assign positive integer prices to vertices so adjacent vertices differ, minimizing total sum, essentially a greedy coloring based on tree structure. | Medium5 | TreeGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Play on WordsDetermine whether all given words can be chained into one sequence where each word's first letter matches the previous word's last letter, using Eulerian path conditions on a letter graph. | Medium5 | GraphUnion-find+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Kingdom RoadmapGiven a tree, compute the minimum number of extra edges needed so the graph stays connected after any single edge removal, which equals the number of leaves divided by two, rounded up. | Medium5 | TreeGraph+1 | No attempts yet | 2s | 128 MB | Judgeable |
| DatabaseDetect whether any two rows in a table share equal values in two distinct columns, and if so output the lexicographically smallest violating row and column pair. | Medium5 | Brute forceHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| EquationEvaluate a postfix expression containing at most one occurrence of variable X as a linear function a*x+b, then solve a*x+b=0 for x as a reduced fraction, handling no-solution and infinite-solution cases. | Medium5 | StackMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| i18nGiven text lines, expand i18n-style abbreviations back into previously seen full words when the expansion is valid and unique, preserving capitalization and separators. | Medium5 | StringHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| DryingGiven drying times per cloth that decrease by 1 each minute (or by k for one chosen cloth per minute on a radiator), find the minimum total minutes to dry all clothes, solved via binary search on time. | Medium5 | Binary searchGreedy | No attempts yet | 2s | 64 MB | Judgeable |
| GodfatherGiven an undirected tree, find all vertices that minimize the largest connected component size after removal (the tree centroid(s)). | Medium5 | TreeDFS+1 | No attempts yet | 2s | 64 MB | Judgeable |
| Horn ClausesParse Horn clause formulas and decide satisfiability by computing the minimal true-variable assignment via forward chaining, or report unsatisfiable. | Medium5 | GraphImplementation+1 | No attempts yet | 2s | 64 MB | Judgeable |
| L PuzzleDetermine whether a black/white grid pattern can be exactly tiled by L-shaped pieces, each with one black corner cell and two adjacent white cells. | Medium5 | GreedySimulation+1 | No attempts yet | 5s | 128 MB | Judgeable |
| The Stable Marriage ProblemGiven male and female preference lists, compute and output the male-optimal stable matching using the Gale-Shapley algorithm. | Medium5 | GreedySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Router Placement to Minimize Maximum TTLGiven a tree, pick the vertex that minimizes the largest distance to any other vertex, and output that minimum maximum distance (the tree's radius). | Medium5 | TreeGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CounterattackTwo strikers advance in lockstep through n points, each step either dribbling or passing to the partner; find the cheapest route from a long pass at point 1 to a shot at point n. | Medium5 | Dynamic programmingArray+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Voyager 1From a starting cell, fire a beam in each of four directions through mirrors / and \, black holes C, and empty cells, and report which direction survives longest or detect an infinite loop. | Medium5 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BalloonsAllocate balloons from two rooms to teams with given distances so total delivery distance is minimized. | Medium5 | GreedySorting | No attempts yet | 1s | 128 MB | Judgeable |
| PalindrometerGiven an odometer reading with fixed digit positions, find the smallest number of kilometers to drive until it reads as a palindrome, counting leading zeros. | Medium5 | StringMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bridges and TunnelsAfter each new edge between two named buildings, print the size of the connected component that the edge joins. | Medium5 | Union-findHash map+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Frosh WeekGiven n distinct student numbers in a line, find the minimum number of adjacent swaps needed to sort them into increasing order. | Medium5 | SortingDivide and conquer+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cantor SetGiven a decimal x between 0 and 1 that ends within 6 fractional digits, decide whether x lies in the Cantor set, that is, whether some ternary expansion of x avoids the digit 1. | Medium5 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Logo 2One numeric argument in a turtle graphics program is missing; find the value that makes the turtle return to its starting point. | Medium5 | GeometryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Team RankingsGiven up to 100 rankings of five teams, find the ranking minimizing the sum of pairwise-order disagreements, breaking ties alphabetically. | Medium5 | Brute forceCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Chat RoomsFor each submitted line, decide accept or reject using consonant-run length, the count of recent suspicious lines, and recent duplicate counts over a sliding window of the last 10 lines. | Medium5 | Sliding windowString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bungee JumpingGiven rope stiffness k, rest length l, bridge height s, and weight w, decide whether Bond gets stuck in the air, dies on impact, or lands safely using energy conservation. Multiple test cases until four zeros. | Medium5 | MathSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Evil Straw Warts LiveFor each string, find the fewest adjacent swaps needed to rearrange it into a palindrome, or report that no palindrome is possible. | Medium5 | GreedyTwo pointers+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Ferry Loading IIGiven car arrival times, ferry capacity n, and one-way time t, find the earliest finish time and the fewest one-way crossings to move all cars. | Medium5 | GreedyImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CoprimeFor each n up to 1e9, count how many positive integers less than n share no common factor with n, handling several test cases until a 0. | Medium5 | Number theoryMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Multiplication GameAlice and Bob multiply a running product by 2 to 9 in turn; find who forces the product to reach n first with optimal play. | Medium5 | Game theoryDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| A Multiple Made Only of OnesGiven n not divisible by 2 or 5, find the number of digits of the smallest repunit (all ones) that n divides. | Medium5 | Number theoryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Tight WordsCount words of length n over digits 0..k where adjacent digits differ by at most 1, then print that count as a percentage rounded to five decimals. | Medium5 | Dynamic programmingCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Splitting Teams FairlySplit N people into two teams differing in size by at most one so their total weight difference is minimized, then print both totals in increasing order. | Medium5 | Dynamic programmingArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Building the ConstellationGiven n points in the plane, connect all of them with straight segments of Euclidean length so the total cost is minimized. | Medium5 | Minimum spanning treeGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Games R UsGroup users into equivalence classes by identical directory access sets, then report classes of size 2 or more. | Medium5 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| FrenemiesFor each dataset, sum the signed scores of all simple paths without neutral links between a given person and every other person. | Medium5 | DFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Extent of the ProblemSimulate RADDD's two-step defragmentation passes over disk blocks and output the final extent layout of every file. | Medium5 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Blue JeansGiven up to 10 DNA strings of length 60, find the longest substring that appears in all of them, breaking ties alphabetically, or report none of length 3 or more. | Medium5 | StringBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TypesettingPack bitmap glyphs as tightly as possible so no visible pixels from different glyphs touch horizontally, then print the result. | Medium5 | SimulationImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Rock SkippingFor each lake map, find the throw (start, skip distance) that maximizes count, then length, then start, then smallest distance, and print it. | Medium5 | Brute forceImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Overflowing BookshelfSimulate a fixed-width shelf through add (push books leftward) and remove events; at End list the surviving books left to right. | Medium5 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SafecrackerGiven a target T and up to 12 distinct uppercase letters, find five distinct letters whose signed power sum equals T; if several work, print the lexicographically greatest string. | Medium5 | Brute forceBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Sum It UpGiven a target and up to 12 numbers, list every distinct subset sum equal to the target, sorted in decreasing lexicographic order. | Medium5 | BacktrackingSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Another Puzzling ProblemEach jigsaw piece carries four integer edge labels; match opposite labels to place every piece in the N by N grid, then print the assembled picture. | Medium5 | ImplementationBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Mark-up ProcessorStrip a small mark-up language from text: handle bold, italic, size, and a toggle that turns processing off, printing only the plain characters. | Medium5 | StringSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Turn of the ShrewEach child's code must differ from the bitwise OR of some male and female adult code; find the minimum Hamming distance over all pairs. | Medium5 | Bit manipulationBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Reverse Roman NotationSimulate a stack calculator where operands are Roman numerals; parse and print them, and handle underflow, division by zero, and out-of-range errors. | Medium5 | ImplementationStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The End of the WorldGiven a valid intermediate state of the Towers of Hanoi, compute how many more moves remain in the optimal solution. | Medium5 | RecursionDivide and conquer+2 | No attempts yet | 1s | 128 MB | Judgeable |
| JugglerBalls sit in a circle with one in hand; rotate either way or drop the held ball, which brings its clockwise neighbor into hand. Find the fewest moves to drop all balls in a given order. | Medium5 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TreesGiven an undirected graph, count its connected components that contain no cycle and report the count per test case. | Medium5 | GraphUnion-find+2 | No attempts yet | 1s | 256 MB | Judgeable |
| RailroadGiven two sequences, decide whether a target sequence can be formed by repeatedly taking the front car of either train; once one train empties, the rest follow in order. | Medium5 | Dynamic programmingTwo pointers+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ShufflingGiven a fixed permutation of N cards and a target order, find the minimum number of times to apply the permutation to reach the target, or -1 if impossible. | Medium5 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PERMSFor each query (n, k), count permutations of 1..n having exactly k inversions, with n up to 18 and k up to 200. | Medium5 | Dynamic programmingCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Sum of Squared DigitsFor two starting numbers, follow the sum-of-squared-digits map and report the smallest total length until a value appears in both sequences, or 0 if they never meet. | Medium5 | Hash mapSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Analyzing Login/Logout RecordsGiven login and logout records on PCs, compute for each query how many minutes a student used at least one PC during a time interval. | Medium5 | IntervalsSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Horror ListEach movie gets a level: 0 if on the horror list, else one plus the best level among similar movies; output the movie with the highest finite level, breaking ties by smallest ID. | Medium5 | GraphBFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Robots on a GridCount monotone right/down paths from the top-left to the bottom-right of an n by n grid with blocked cells, modulo 2^31-1, and report whether the goal is reachable at all, or reachable only with up and left moves allowed. | Medium5 | Dynamic programmingDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| lsGiven a wildcard pattern where * matches any run of characters, print the input file names that match it, keeping input order. | Medium5 | Dynamic programmingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Royal SuccessionGiven parent pairs for N people, compute each claimant's inherited fraction of the founder's blood and print the claimant with the largest fraction. | Medium5 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Playfair CipherBuild a 5x5 Playfair key table from a key phrase, split the plaintext into digraphs with X padding, and apply the row, column, or rectangle substitution rules. Output the uppercase ciphertext. | Medium5 | SimulationMatrix+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ShopaholicGiven item prices, group them into triples so that the cheapest item in each triple is free, and maximize the total discount. | Medium5 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ConstellationsGiven up to 500 star coordinates, connect each star to its nearest neighbor(s) and count the connected components of the resulting graph. | Medium5 | GraphUnion-find+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Image SegmentationGiven an H by W color image, band each RGB value by dividing by S, then count 8-connected regions of equal band triples whose pixel size is at least L. | Medium5 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bat PositioningFind the point that equals the centroid of exactly the pointers lying at least 100 units away from it, rounding coordinates to the nearest integer. | Medium5 | GeometryImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Road TripGiven a weighted tree rooted at city 1, remove exactly one non-root vertex so the round trip from city 1 covering all remaining cities is shortest, and report that length. | Medium5 | TreeDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Rig PlacementGiven n oil fields, a per-field investment cap m, and a total budget B, pick an investment amount for each field so total oil is maximized. | Medium5 | Dynamic programmingArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Overlap!Given each course's exam day and time slot and each student's course list, count students who have two or more finals that overlap in time. | Medium5 | ImplementationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Study DaysDistribute H study hours among n courses, each with 10 grade thresholds, to maximize the average grade point, rounded to two decimals. | Medium5 | Dynamic programmingArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Yes or No?Pick between l and r questions to answer Yes, maximizing the sum of per-question expected correct probabilities, and report the maximum expectation to two decimals. | Medium5 | Dynamic programmingSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Throw a Party!!!Given friends' home regions with drunk/sober status and cars with capacity bound to regions, compute how many friends cannot be seated (each car needs a sober driver). | Medium5 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Biomedical EngineeringGiven a target string and a set of reusable component strings, find the minimum number of components whose concatenation equals the target, or report that it is impossible. | Medium5 | Dynamic programmingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| GerrymanderingSplit n precincts, each with P and Q vote counts, into two nonempty districts; find how many districts P can win (0, 1, or 2). | Medium5 | Dynamic programmingArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| And the Winner IsEach ballot has one character per candidate; discard any ballot that marks more than one candidate in the same race, then report the top vote-getter (ties included) in every race, in input order. | Medium5 | ImplementationArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SoccerCompute probability distribution of final scores after up to T seconds of a stochastic soccer simulation with passing, stealing, shooting, and absorbing states. | Medium5 | ProbabilityDynamic programming+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Battleground PreservationGiven past battle results with costs, find the cheapest chain of victories between two fighters and decide the winner, or output FIGHT! if neither dominates. | Medium5 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Life ConnectionsGiven an undirected friendship graph, count the distinct shortest paths between each queried pair of nodes, where path length counts nodes. | Medium5 | GraphBFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Pirates' PathFind the path from s to e in an undirected graph that uses the fewest guarded edges, where each edge has cost 0 or 1. | Medium5 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Decimal to FractionConvert a decimal string, with an optional repeating block in parentheses, into the exact fraction in lowest terms. | Medium5 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Jumbled LettersFor each query, find the longest dictionary word that can be formed using the query letters at most once, breaking ties alphabetically, or report IMPOSSIBLE. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bad WiringEach switch toggles a window of 2D+1 lights; find the fewest flips that turn every light off, or report impossibility. | Medium5 | GreedyBit manipulation | No attempts yet | 3s | 128 MB | Judgeable |