Curated sets

Interview warm-up

Short whiteboard tasks to get the rust off.

All problems
Total results2,493 problems
TopicsJudge
Factorial BaseRead each factorial-base number, weight digit at position i (from the right, 1-indexed) by i!, and print the decimal value.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
PangramRead sentences until a line holding a single asterisk, and print Y if a sentence contains all 26 lowercase letters, otherwise N.Easy2StringHash map+1No attempts yet1s128 MBJudgeable
FeynmanFor each N, count all axis-aligned squares contained in an N by N grid of unit cells, ending at the sentinel 0.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Head or TailFor each test case, count the zeros and ones in the list of game results and print how many games Mary and John each won.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Pascal LibraryGiven D attendance rows over N alumni, decide whether some alumnus attended every dinner.Easy2ArrayImplementation+1No attempts yet1s128 MBJudgeable
Grade StatisticsFor each class, read the scores, then report the maximum, the minimum, and the largest gap between neighboring scores after sorting in descending order.Easy2SortingImplementation+1No attempts yet1s128 MBJudgeable
Roll-call in Woop Woop HighRead each class's answers and count pupils into four groups: correct first try, correct late, never correct, and absent.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
Breed ProximityGiven a line of N cows with breed ids, find the largest breed id whose two occurrences lie within K positions of each other, or -1 if none exist.Easy2ArrayHash map+1No attempts yet1s128 MBJudgeable
Contest TimingShe starts at 11:11 on 11/11. Given the day, hour, and minute she stops, print the minutes elapsed, or -1 if the stop is earlier.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
Odd or EvenRead N large integers up to 10^60 and print odd or even for each, judging parity from the last digit.Easy2StringMath+2No attempts yet1s128 MBJudgeable
Barn EchoesGiven two lowercase strings, find the length of the longest string that is a prefix of one and a suffix of the other.Easy2StringBrute force+2No attempts yet1s128 MBJudgeable
Papaya JungleBessie moves greedily through a grid, always stepping to the adjacent square with the most uneaten papayas, and we sum the fruit she eats until she reaches the bottom-right corner.Easy2SimulationArray+2No attempts yet1s128 MBJudgeable
Scavenger HuntList every pair (x, y) where x divides P and y divides Q, sorted by x then y.Easy2MathBrute force+1No attempts yet1s128 MBJudgeable
Hay ExpensesGiven N daily hay counts and Q ranges, output the sum of counts over each range from S to E inclusive.Easy2Prefix sumArrayNo attempts yet1s128 MBJudgeable
StatisticsRead N integers, print their mean and median rounded to six decimal places.Easy2ArraySorting+2No attempts yet1s128 MBJudgeable
TV ReportsTrack daily Dollar prices against the previous day and the running all-time high, printing NTV drop headlines and BBTV record headlines in day order.Easy2ImplementationSimulation+2No attempts yet1s128 MBJudgeable
IBM Minus OneFor each of n uppercase names, shift every letter to the next letter of the alphabet, wrapping Z to A, and print the result with numbered headers.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Color Me LessRead 16 target RGB colors, then map each following color to the nearest target color by Euclidean distance, breaking ties by earliest appearance.Easy2ImplementationBrute force+2No attempts yet1s128 MBJudgeable
Getting ChordedGiven three note names, decide whether their semitone spacing forms a major or minor chord, then print the echo with the root-named chord or "unrecognized".Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
Deli DeliFor each of N words, apply the first matching pluralization rule from a list of irregular forms and four suffix rules, then print the result.Easy2StringHash map+2No attempts yet1s128 MBJudgeable
Next in LineGiven the ages of the youngest and middle of three children in an arithmetic sequence, print the oldest child's age.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Rotating LettersGiven a single uppercase word, decide whether every letter belongs to the set of seven letters that look the same after a 180-degree rotation.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Speed fines are not fine!Given a speed limit and a recorded speed, decide whether the car is speeding and print the matching fine from a three-tier table.Easy2ImplementationMath+2No attempts yet2s512 MBJudgeable
Big Bang SecretsDecode an uppercase word by shifting each letter backward by S = 3P + K positions, where P is the letter's 1-based position.Easy2ImplementationString+1No attempts yet2s512 MBJudgeable
Sumac SequencesStarting from two integers, repeatedly replace the pair with (second, first minus second) until the difference turns negative and report how many terms appear.Easy2SimulationMathNo attempts yet2s512 MBJudgeable
What is n, Daddy?Count the ordered pairs (a, b) with 1 <= b <= a <= 5 and possibly a single hand, summing to n.Easy2MathBrute force+2No attempts yet2s512 MBJudgeable
Computer PurchaseGiven n computers with RAM, CPU speed, and disk values, sort by the score 2R + 3S + D and print the top two names, breaking ties by smaller name.Easy2SortingImplementationNo attempts yet2s512 MBJudgeable
ISBN 1-3-SumGiven the last three digits of an ISBN starting with 9780921418, compute the 1-3-sum and print it.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
Do the ShuffleSimulate a fixed 5-song playlist through button presses that rotate left, rotate right, or swap the first two songs, then print the final order.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
It's Cold Here!Read city names with integer temperatures, one per line, and print the name of the city with the lowest temperature.Easy2ImplementationArray+2No attempts yet1s128 MBJudgeable
Who is in the middle?Given the weights of three bowls, print the middle value among the three weights.Easy2SortingImplementationNo attempts yet1s128 MBJudgeable
Deal or No Deal CalculatorRead eliminated case numbers and a Banker's offer, compute the average of the remaining amounts, and print deal if the offer is higher, otherwise no deal.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Anagram CheckerDecide whether two phrases are anagrams, ignoring spaces and letters only.Easy2Hash mapString+1No attempts yet1s128 MBJudgeable
The Cell SellGiven daytime, evening, and weekend minutes, compute the monthly cost under two phone plans and print the cheaper one.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
Snow CallsConvert each alphanumeric phone number to digits, keep the first 10 digits, and print them in xxx-xxx-xxxx form.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Mouse MoveThe cursor starts at (0,0) on a screen of width c and height r; each relative move is clamped to the screen edges, and the position after every move must be printed.Easy2SimulationImplementation+2No attempts yet1s128 MBJudgeable
SquaresGiven a number of tiles, find the largest integer side length whose square does not exceed that number.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
Terms of OfficePrint every year from X to Y in which all four offices change, which happens on multiples of lcm(4,2,3,5) = 60, formatted as a fixed sentence.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Smile with SimilesGiven up to five adjectives and five nouns, print every phrase of the form "<adjective> as <noun>" in nested input order.Easy2ImplementationBrute force+2No attempts yet1s128 MBJudgeable
Constrained PermutationsCount permutations of 1..n (n at most 9) that satisfy given ordering constraints x before y.Easy2Brute forceCombinatorics+2No attempts yet1s128 MBJudgeable
AmeriCanadianRead words one per line until the line quit!, and for each word rewrite a trailing consonant followed by or as our when the word has at least five letters.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Fraction ActionReduce a numerator and denominator to simplest form, then print it as a whole number, a proper fraction, or a mixed number.Easy2MathNumber theory+1No attempts yet1s128 MBJudgeable
Dressing UpRead an odd height H and print a bow tie of H rows where each side widens as rows approach the middle.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
CalendarGiven the weekday of the 1st and the number of days, print a month calendar in a fixed weekly layout with right-aligned columns.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
Shift LettersFor each test case, rotate the letters of a word right by n positions and print the result in a fixed sentence format.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
AnagramsGiven two lowercase words, decide whether one can be rearranged into the other, and print the result with the words.Easy2StringHash map+1No attempts yet1s128 MBJudgeable
StringCollapse every run of identical consecutive letters in a lowercase string into a single letter and print the result.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
NonogramGiven a grid of black and white squares, print the lengths of the consecutive black blocks in each row and then each column.Easy2ImplementationArray+2No attempts yet1s1024 MBJudgeable
NumbersGiven three distinct digits and one of their six permutations, find that number's 1-based rank when all six permutations are sorted ascending.Easy2MathSorting+2No attempts yet1s1024 MBJudgeable
Building BlocksGiven a target height N and three block heights, pick the kind whose multiples get closest to N, breaking ties by smaller block then shorter tower.Easy2MathBrute forceNo attempts yet1s1024 MBJudgeable
CardsA 52-card deck is missing exactly one card; given the other 51 cards as suit and value pairs, output the missing suit and value.Easy2ArrayHash map+2No attempts yet1s1024 MBJudgeable
The Worm TurnsSimulate a 20-cell worm on a 50x50 grid through a list of moves, stopping when it hits itself, leaves the board, or finishes.Easy2SimulationImplementation+2No attempts yet1s128 MBJudgeable
Counting SheepCount how many words in each list match the string "sheep" exactly, case-sensitive, and print the count per list with blank lines between cases.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
EntropyRead one line of text, count how often each character appears, and print the Shannon entropy rounded to three decimals.Easy2Hash mapMath+2No attempts yet1s128 MBJudgeable
Right Triangle CheckFor each of n triples of side lengths, decide whether the triangle is right by checking if the largest side squared equals the sum of the other two squared.Easy2MathGeometry+2No attempts yet1s128 MBJudgeable
GaussFor each test case, compute the sum of all integers from n to m inclusive and print the test case number followed by the sum.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
ExerciseFor each machine, multiply each exercise level's energy rate by its duration and sum the totals per person.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
TeleprimeGiven a six-digit number and a digit to prepend, print Yes if both the original and the resulting seven-digit number are prime.Easy2Number theoryMath+2No attempts yet1s128 MBJudgeable
Ways to Make RectanglesCount the number of unordered pairs (a, b) with a <= b and a*b <= n.Easy2MathBrute force+1No attempts yet1s256 MBJudgeable
Ant NamesGiven up to 100 lowercase names, print the maximum number of distinct letters found in any single name.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Rhyming VersesCount pairs of lines with the same number of vowels and identical last k letters ignoring spaces.Easy2StringImplementationNo attempts yet1s512 MBJudgeable
ParkFor each of up to one million heights in order, output the maximum height to its west and to its east, using its own height when no higher point exists.Easy2Prefix sumArrayNo attempts yet1s512 MBJudgeable
Bagels on a StickSlide a chosen bagel off one end of the stick after removing the fewest bagels it cannot slide through.Easy2ArrayNo attempts yet1s512 MBJudgeable
Hidden NumberSum every maximal run of digits in a word of letters and digits, ignoring leading zeros.Easy2StringImplementationNo attempts yet1s256 MBJudgeable
Caesar CipherDecode a Caesar-shifted uppercase message by matching its most frequent letter to the given original letter.Easy2StringArray+1No attempts yet1s512 MBJudgeable
Sums and DifferencesCount ordered pairs from distinct positions where the difference exceeds the sum, which holds exactly when the second element is negative.Easy2MathCombinatoricsNo attempts yet1s128 MBJudgeable
Step on the FootKozik and Adrian alternately shorten the gap by their foot lengths, and the first player facing a gap shorter than his foot wins.Easy2MathNo attempts yet1s128 MBJudgeable
Dividing the Chocolate BarTwo brothers split an a by b chocolate bar with one straight cut so the two pieces differ in area as little as possible.Easy2MathNo attempts yet1s128 MBJudgeable
Overlapping Rectangle AreaGiven two axis-aligned rectangles, compute the area of their overlapping region.Easy2GeometryNo attempts yet1s128 MBJudgeable
Ranking ManipulationChoose weights on the tasks you solved so you finish first, then count the contestants tied with you.Easy2ArrayImplementationNo attempts yet1s128 MBJudgeable
Making Grid PaperPick the sheet that yields the most grid cells under the margin and spacing rules, breaking ties by area, and output its area.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
ThumbtacksFind the smallest jump that crosses the bridge using only planks without thumbtacks.Easy2ArrayNo attempts yet1s128 MBJudgeable
ChessEach row holds at most one rook, so take the largest value in every row with a positive maximum and add them.Easy2GreedyArrayNo attempts yet1s128 MBJudgeable
Pear Trees and Apple TreesFind the largest distance between any pear tree and any apple tree in a row of n trees.Easy2ArrayNo attempts yet1s128 MBJudgeable
MondaysGiven year length N, week length M, and starting weekday L, count the days from 1 to N that fall on the first weekday.Easy2MathNo attempts yet1s128 MBJudgeable
KaraokeCount the starting positions where the next K characters of the song string are all vowels.Easy2Sliding windowStringNo attempts yet2s128 MBJudgeable
Palindrome ColoringSplit each A/B string into the fewest palindromic subsequences and output that count.Easy2StringTwo pointersNo attempts yet1s128 MBJudgeable
Rock Paper ScissorsCompare the two players' winning chances from their move probabilities and print who is more likely to win each match.Easy2ProbabilityMath+1No attempts yet1s128 MBJudgeable
Shoe FactoryChoose the price p from 1 to N that maximizes the count of buyers willing to pay p times the margin p minus K.Easy2Prefix sumBrute forceNo attempts yet1s128 MBJudgeable
BookmakersDecide whether stakes on both match outcomes can guarantee a profit given decimal odds X and Y.Easy2MathNo attempts yet1s128 MBJudgeable
Rock Paper ScissorsSimulate k rounds of rock-paper-scissors across N robots, removing round losers until one robot remains or all rounds end in a draw.Easy2SimulationNo attempts yet1s128 MBJudgeable
TurtleSimulate the turtle's moves from the origin and report the area of the axis-aligned bounding box of its path.Easy2SimulationNo attempts yet1s128 MBJudgeable
SalesFor each test case, count pairs of days where the earlier day sold no more than the later day and print the total.Easy2Brute forceArrayNo attempts yet1s128 MBJudgeable
Careless AdditionAdd two integers digit by digit from the right with no carries and print the column sums in order.Easy2ImplementationStringNo attempts yet1s128 MBJudgeable
TrainPassengers board in order into the non-full car with the fewest same-initial riders, ties broken by load then car number, and the program prints each car count.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Olympic Country RankingCount how many countries beat country K on gold, then silver, then bronze medals, and report its rank.Easy2SortingArrayNo attempts yet1s128 MBJudgeable
Old BillGiven N and middle digits XYZ, fill in the first and last digits of the five-digit total so N divides it, choosing the largest valid total.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
ClockFind the time with the median clock-hand angle among five given times, breaking angle ties by earlier time.Easy2MathSorting+1No attempts yet1s128 MBJudgeable
DisplayFit the words of a space-separated text into the fewest rows of width w, breaking a row only when the next word does not fit.Easy2GreedySimulationNo attempts yet1s128 MBJudgeable
Tidying the Banquet TablesFour teams sit mixed across four tables, and you assign one team to each table so the fewest guests move.Easy2Brute forceMatrixNo attempts yet1s128 MBJudgeable
Mathematical CuriosityCount pairs 0<a<b<n where a squared plus b squared plus m is divisible by a times b.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
Sir Bedavere's Bogus DivisionPrint every three-digit fraction with numerator in L to R that keeps its value after erasing the shared digit.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
Consecutive Digits in a Rational NumberReport the base-7 digits in positions f through l after the point for the fraction n over d.Easy2SimulationMathNo attempts yet1s128 MBJudgeable
Pig LatinConvert each word to Pig Latin by moving leading consonants to the end and appending ay.Easy2StringSimulationNo attempts yet1s128 MBJudgeable
Crossword Puzzle Clue NumberingScan the letter grid, number each square that starts an across or down word, and list every entry number with its letter count.Easy2SimulationMatrix+1No attempts yet1s128 MBJudgeable
Winning at tic-tac-toeTry each empty cell on the 3x3 board and print the board with the smallest winning move filled.Easy2Brute forceImplementationNo attempts yet1s128 MBJudgeable
Painting PartyPaint up to 100 filled or one-pixel-border rectangles in order on an N by N grid and print the final colors.Easy2SimulationMatrixNo attempts yet5s128 MBJudgeable
Integer FlippingReverse the order of the 32 bits of each given unsigned integer and print the resulting value, stopping at -1.Easy2Bit manipulationNo attempts yet1s128 MBJudgeable
Ironclad Security AlgorithmYou invert the word permutation defined by the two public keys and apply it to the ciphertext to recover the plaintext.Easy2Hash mapArrayNo attempts yet1s256 MBJudgeable
Fast Food PrizesAdd up, over disjoint prize sets, the prize value times the smallest sticker count among its required kinds.Easy2GreedyMath+1No attempts yet2s128 MBJudgeable