Curated sets

Interview warm-up

Short whiteboard tasks to get the rust off.

All problems
Total results2,493 problems
TopicsJudge
ResistanceGiven three color names, map each to its digit or multiplier using a fixed table and print the resulting resistance value.Easy1Hash mapImplementationNo attempts yet2s128 MBJudgeable
Escape from a RectangleGiven a point inside an axis-aligned rectangle, compute the minimum distance from the point to the nearest side of the rectangle.Easy1MathGeometry+1No attempts yet2s128 MBJudgeable
Counting VowelsFor each input line until a terminating '#', count how many letters are vowels regardless of case.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Rugby ClubRead repeated name/age/weight lines until a sentinel and print whether each member is Senior or Junior based on simple thresholds.Easy1ImplementationNo attempts yet1s128 MBJudgeable
Cutting ChocolateCompute the minimum number of straight cuts needed to divide an N by M chocolate bar into all 1x1 pieces.Easy1MathImplementationNo attempts yet2s128 MBJudgeable
Print Stars - 3Print N lines of stars where the count decreases from N down to 1.Easy1ImplementationNo attempts yet1s128 MBJudgeable
Oven ClockGiven a start time and a number of minutes to cook, compute and print the finishing time on a 24-hour clock.Easy1MathSimulationNo attempts yet1s128 MBJudgeable
Average and MedianRead five natural numbers and print their average and median.Easy1SortingArray+1No attempts yet1s128 MBJudgeable
MultiplicationGiven two three-digit numbers, print the partial products from vertical multiplication and their total.Easy1MathImplementationNo attempts yet1s128 MBJudgeable
String RepetitionGiven repeat count R and string S, output the string formed by repeating each character of S exactly R times in order.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Least Common Multiple and Greatest Common DivisorFor multiple integer pairs, compute and print each pair's least common multiple and greatest common divisor.Easy1MathNumber theoryNo attempts yet1s128 MBJudgeable
Typo Man Go ChangyoungGiven a string and a 1-based position, output the string with that one character removed, for multiple test cases.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Multiplication TablePrint the multiplication table for a given integer N from N*1 to N*9 in the exact required format.Easy1ImplementationNo attempts yet1s128 MBJudgeable
Fibonacci NumberCompute the nth Fibonacci number for n up to 45.Easy1MathImplementationNo attempts yet1s128 MBJudgeable
Leap YearGiven a year, output 1 if it is a leap year according to the standard divisibility rule, otherwise output 0.Easy1MathImplementationNo attempts yet1s128 MBJudgeable
After the PartyCompute actual attendees as L times P, then output the difference between each of five reported counts and that value.Easy1MathImplementationNo attempts yet1s128 MBJudgeable
FBIGiven five agent codes, print the 1-based positions of those containing the substring FBI, or a fixed message if none do.Easy1StringImplementationNo attempts yet0.25s128 MBJudgeable
Alarm ClockGiven an alarm time in hours and minutes, compute and print the time 45 minutes earlier, wrapping around midnight if needed.Easy1MathImplementationNo attempts yet1s128 MBJudgeable
SangsuReverse two given three-digit numbers digit by digit and print the larger reversed value.Easy1MathImplementationNo attempts yet1s128 MBJudgeable
Completing a Chess SetGiven counts of six white chess piece types, output how many of each must be added or removed to reach a complete 16-piece set.Easy1ArrayImplementationNo attempts yet1s128 MBJudgeable
ABCSort three distinct numbers into A, B, C and print them in an order given by a 3-letter permutation string.Easy1SortingImplementationNo attempts yet1s128 MBJudgeable
The Good and the BadCount the letters g and b in each hero name, ignoring case, and print whether the name is GOOD, A BADDY, or NEUTRAL.Easy1StringImplementation+1No attempts yet1s128 MBJudgeable
Line NumbersRead N lines of text and print each one prefixed with its 1-based line number in the format "number. content".Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
Mirror, Oh! MirrorRead lines of ASCII text until a line of three asterisks, and print each line with its characters reversed.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Spinner Lock SimulationGiven the starting digits of a spinner lock and a sequence of button labels, add each label's digits to the wheels modulo 10 and print the final readout.Easy1SimulationImplementation+2No attempts yet1s128 MBJudgeable
TGN Advertising DecisionFor each test case, compare the no-ad revenue r against e minus c, then print advertise, do not advertise, or does not matter.Easy1ImplementationMathNo attempts yet1s128 MBJudgeable
Triangle and Its Three SidesRead triples of positive integers until 0 0 0, and for each print Equilateral, Isosceles, Scalene, or Invalid based on equal sides and the triangle inequality.Easy1ImplementationMath+1No attempts yet1s128 MBJudgeable
Divisors and MultiplesFor each pair of numbers, print factor if the first divides the second, multiple if the first is a multiple of the second, or neither.Easy1MathImplementationNo attempts yet1s128 MBJudgeable
Even Sum Versus Odd SumFor each of up to 50 sequences, add the even numbers and the odd numbers separately and print EVEN, ODD, or TIE based on which sum is larger.Easy1ArrayImplementationNo attempts yet1s128 MBJudgeable
BillingRead item names until EOI and print the total cost of all listed supplies with a dollar sign and two decimals.Easy1Hash mapImplementationNo attempts yet1s128 MBJudgeable
Battle Droid PriceFor each test case, multiply five part quantities by fixed prices, sum them, and print the total with a dollar sign and two decimals.Easy1MathImplementation+2No attempts yet1s128 MBJudgeable
Entry Log ManagementRead N names and print each one converted to lowercase, one per line.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
The Errand RouteAdd four travel times given in seconds and print the total split into minutes on the first line and seconds on the second.Easy1MathImplementationNo attempts yet1s128 MBJudgeable
ReceiptGiven the total price of 10 books and the prices of 9 of them, find the missing book's price.Easy1MathImplementationNo attempts yet1s128 MBJudgeable
JOI and IOICount how many length-3 windows of a string equal JOI and how many equal IOI, including overlaps.Easy1StringBrute force+1No attempts yet1s128 MBJudgeable
Exam ScoresGiven the four subject scores of two students, print the larger of the two totals, or Minguk's total when they tie.Easy1ImplementationMathNo attempts yet1s128 MBJudgeable
Find the Students Who Didn't SubmitGiven 28 distinct attendance numbers from 1 to 30, print the two missing numbers in increasing order.Easy1ArrayImplementationNo attempts yet1s128 MBJudgeable
Do-it, Do-it-NotFor each test case, compare the two middle digits of an even-length binary string and print Do-it if they match, otherwise Do-it-Not.Easy1StringImplementation+1No attempts yet1s128 MBJudgeable
Reverse TextRead each test case line and print its characters in reverse order.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Sounds fishy!Read four depth readings and print Fish Rising, Fish Diving, Fish At Constant Depth, or No Fish based on their ordering.Easy1ImplementationArrayNo attempts yet2s512 MBJudgeable
Which Alien?Given the number of antennae and eyes a witness saw, print the names of all alien species whose ranges match, in the order given.Easy1ImplementationBrute force+1No attempts yet2s512 MBJudgeable
Multiple ChoiceRead a student's N answers followed by the N correct answers, and count how many positions match.Easy1ArrayImplementationNo attempts yet2s512 MBJudgeable
AlienGiven a point and n axis-aligned rectangles, decide whether any rectangle contains the point, boundaries included.Easy1GeometryImplementation+2No attempts yet2s128 MBJudgeable
FactorialRead n and print the ones digit of n factorial.Easy1MathImplementationNo attempts yet1s128 MBJudgeable
LifeguardThe task is to count children farther than k meters from the lifeguard position.Easy1GeometryMathNo attempts yet1s512 MBJudgeable
Letter CounterCount how many times each letter appears across the given lines and print nonzero counts from a to z then A to Z.Easy1ArrayStringNo attempts yet1s512 MBJudgeable
Long TapeChoose a nonempty contiguous segment of the given sequence so its arithmetic mean is as small as possible.Easy1ArrayNo attempts yet1s128 MBJudgeable
FiguresCheck whether any three consecutive figures contain one circle, one square, and one triangle.Easy1Sliding windowArrayNo attempts yet1s128 MBJudgeable
WężykPrint the numbers 1 to n squared in n rows that alternate between left-to-right and right-to-left order.Easy1SimulationMatrixNo attempts yet1s128 MBJudgeable
Flipping CoinsCount the heads and tails and flip the coins on the less frequent side so all coins show the same face.Easy1GreedyArrayNo attempts yet1s128 MBJudgeable
Caesar CipherGiven the encrypted message and its original first letter, recover the shift and decode the full message.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
StrollGiven a walk of N, S, E and W steps on a grid, compute the Manhattan distance from the endpoint back to the start.Easy1SimulationMathNo attempts yet2s128 MBJudgeable
Letter BankDecide whether the second word uses exactly the letters of the first word, each at least once.Easy1Hash mapStringNo attempts yet1s128 MBJudgeable
First and Last LetterPrint the first and last letter of each given uppercase string, doubling the letter for length 1.Easy1StringNo attempts yet1s128 MBJudgeable
Reverse Each WordFor each of T sentences, print the words in the same order with the letters inside every word reversed.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Kkung's Space TripCount the ships that reach the destination by checking whether each ship's fuel covers its burn rate over the travel time.Easy1MathImplementationNo attempts yet2s128 MBJudgeable
Fraud BustersMatch each 9-character database code against the scanned code, treating every star as a wildcard, and print the matches in input order.Easy1String matchingImplementationNo attempts yet1s128 MBJudgeable
Balloon ColorsCheck whether the first color differs from X and the last color differs from Y, then print BOTH, EASY, HARD, or OKAY.Easy1ImplementationNo attempts yet1s128 MBJudgeable
Birthday StatisticsCount how many of the n employees were born in each month and print the twelve monthly totals.Easy1ArrayImplementationNo attempts yet1s128 MBJudgeable
Encoding Binary NumbersEncode each binary string as run lengths followed by digits and print the result per line.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Christmas Gift DrawGiven the gift each guest drew, print for every guest who received the gift they brought.Easy1ArrayNo attempts yet2s512 MBJudgeable
GiftCount the days on which the recorded time is at least k milliseconds faster than the previous day.Easy1ArrayImplementationNo attempts yet2s512 MBJudgeable
Morton NumbersRead integers x and y and print their Morton number, built by interleaving the bits of x and y.Easy1Bit manipulationNo attempts yet2s512 MBJudgeable
Gray codeConvert an n-bit binary string to its standard Gray code by copying the first bit and adding each adjacent pair of bits without carry.Easy1Bit manipulationStringNo attempts yet1s128 MBJudgeable
Ship SelectionCount the ships whose fuel covers consumption times the integer-division travel time for the given distance.Easy1ImplementationMathNo attempts yet1s256 MBJudgeable
AcronymsGiven an acronym and candidate phrases, print the phrases whose word initials match the acronym letters in order.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
Longest Run of X'sCount the longest run of consecutive X marks in each hallway and print its length in the required sentence.Easy1ArrayNo attempts yet1s256 MBJudgeable
Count VowelsCount the vowels a, e, i, o, and u in each given lowercase word and print the result in the required sentence.Easy1StringNo attempts yet1s256 MBJudgeable
Golden Khon KaenCount how many times the word GOLDEN can be formed from each given string of capital letters.Easy1Hash mapNo attempts yet10s64 MBJudgeable
ServerCount how many jobs from the front finish in request order before their total duration exceeds T.Easy1Prefix sumSimulationNo attempts yet1s256 MBJudgeable
Subin and the SequenceGiven the prefix averages of a sequence, recover the original sequence term by term.Easy1Prefix sumMathNo attempts yet1s32 MBJudgeable
Mosquito TrapFind the smallest area of an axis-aligned square that covers all given points on the table.Easy1GeometryNo attempts yet1s32 MBJudgeable
Keystrokes per FingerCount how many times each of the eight fingers presses a key when the given string is typed on the fixed US layout.Easy1ImplementationArrayNo attempts yet1s32 MBJudgeable
Christmas PartyTally each friend's score over M guessing games from the targets and the written names.Easy1ImplementationNo attempts yet1s256 MBJudgeable
Vertical ReadingRead five given words column by column from top to bottom, skipping missing letters in shorter words, and print the letters in that order.Easy1SimulationArray+1No attempts yet1s256 MBJudgeable
Reversing Card SegmentsReverse ten given segments of a 20-card row that starts in order and print the final arrangement.Easy1ArraySimulationNo attempts yet1s256 MBJudgeable
Count ValueCount how many times the integer v appears among the N given integers.Easy1ArrayNo attempts yet1s256 MBJudgeable
Find the AlphabetGiven a lowercase word of length at most 100, output the 0-based first index of each letter a to z, or -1 when absent.Easy1ArrayStringNo attempts yet1s256 MBJudgeable
Insert BallsFill N baskets by writing ball number k into baskets i through j for each operation, then print all baskets.Easy1ArraySimulationNo attempts yet1s256 MBJudgeable
The nth Fibonacci NumberGiven n up to 20, compute the nth Fibonacci number defined from 0 and 1.Easy1Dynamic programmingRecursionNo attempts yet1s256 MBJudgeable
N-orthotopeGiven two axis-aligned boxes in N dimensions, print the dimension of their overlap, or -1 when they do not meet.Easy1ImplementationGeometryNo attempts yet1s256 MBJudgeable
Palindrome CheckCheck whether the given lowercase word reads the same forward and backward and print 1 or 0.Easy1StringTwo pointersNo attempts yet1s256 MBJudgeable
Use Every LetterDecide for each of up to 50 sentences whether it contains every letter a to z, and list the missing letters otherwise.Easy1StringArrayNo attempts yet2s256 MBJudgeable
Communication ChannelsCompare each transmitted binary string with its received copy and print OK when they match and ERROR otherwise.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
Balancing WeightsYou sum the signed positions of the weights and report whether the lever tips left, tips right, or stays balanced.Easy1ImplementationMathNo attempts yet1s256 MBJudgeable
Logical Functions: AND and ORCheck each submitted weight and bias by testing all four binary inputs and report whether the neuron matches the requested AND or OR gate.Easy1SimulationImplementationNo attempts yet2s256 MBJudgeable
Affine CipherApply E(X) = (aX + b) mod 26 to each uppercase letter of the plaintext and print the ciphertext.Easy1ImplementationString+1No attempts yet5s256 MBJudgeable
The Princess and the Magic MirrorPrint an N by N picture unchanged, mirrored left to right, or flipped top to bottom according to the given mood number.Easy1MatrixImplementationNo attempts yet2s256 MBJudgeable
PersistenceCount how many times multiplying the decimal digits together reduces the given number to a single digit.Easy1SimulationImplementationNo attempts yet1s256 MBJudgeable
Box intersection volumeCompute the volume shared by N axis-aligned boxes by intersecting their x, y, and z ranges.Easy1MathNo attempts yet1s256 MBJudgeable
CardsTwo cards are compared at a time with the smaller pocketed, so find the largest possible sum of pocketed numbers for the given row.Easy1ArrayNo attempts yet1s32 MBJudgeable
Power of TwoPrint 1 if the given natural number N is a power of two and 0 otherwise.Easy1Bit manipulationNo attempts yet2s512 MBJudgeable
Magic TrickFind the card shared by the chosen rows of two 4 by 4 layouts, or report a bad layout or cheating.Easy1ArrayImplementationNo attempts yet5s512 MBJudgeable
George BooleRead one boolean operation in the form true AND false and print its result.Easy1ImplementationString+2No attempts yet2s512 MBJudgeable
Hamming DistanceRead two n-dimensional integer vectors and count the positions where their entries differ.Easy1ImplementationArrayNo attempts yet1s256 MBJudgeable
Grass Seed Inc.Given the cost per square metre and a list of rectangular lawns, print the total cost of seeding all of them, rounded to seven decimals.Easy1MathImplementationNo attempts yet2s512 MBJudgeable
HandballGiven each player's goal counts across M matches, count how many players scored at least once in every match.Easy1ArrayImplementationNo attempts yet2s512 MBJudgeable
Zero or OneGiven three bits picked by three players, print the player whose bit differs from the other two, or * if there is no such player.Easy1ImplementationBrute forceNo attempts yet1s512 MBJudgeable
The Y Bus Goes VroomSimulate the passenger count as a bus travels N stops with given boarding and alighting numbers, then print the driver's fixed name.Easy1SimulationImplementation+1No attempts yet2s256 MBJudgeable
Pick the QuadrantRead the x and y coordinates of a nonzero point and print which of the four quadrants it lies in.Easy1ImplementationMathNo attempts yet1s512 MBJudgeable