Pair Sum
Easy · Hash Map · Arrays
Find two numbers that add to a target and return their positions. Walk the list once, remembering each number seen: for two_sum([2, 7, 11, 15], 9), 9 - 2 = 7 is already seen, so the answer is [0, 1].
Direct your coding agent, review the file it writes, and test it against evolving requirements. Each scenario has three stages and a limited prompt budget.
Your agent writes the solution. You decide what to ask, what to check, and when it is ready.
Progress is saved for this browser. Solved means all code acceptance checks passed. Pass 5 practice scenarios to unlock Ranked.
Learn the system with your agent. Repeatable and unscored — no defense, no passport entry.
Easy · Hash Map · Arrays
Find two numbers that add to a target and return their positions. Walk the list once, remembering each number seen: for two_sum([2, 7, 11, 15], 9), 9 - 2 = 7 is already seen, so the answer is [0, 1].
Medium · Sorting · Intervals
Fold overlapping time ranges into one clean cover. Sort by start, then sweep: [1, 3] and [2, 6] overlap into [1, 6], while [8, 10] and [15, 18] stand alone.
Medium · Sliding Window · Arrays
Guard an API: each request is allowed only while fewer than capacity already-allowed requests sit inside the window. With capacity 2 and window 5, requests at [0, 1, 2, 3] give [1, 1, 0, 0] — denied requests never consume quota.
Medium · Math · Simulation
Schedule waits between retries that grow exponentially but never pass a cap. With base 1, factor 2, cap 5 over 4 failures: waits are 1, 2, 4, then 8 capped to 5 — [1, 2, 4, 5].
Medium · Sorting · Intervals
Book the fewest rooms that fit every meeting. Sort starts and ends, then sweep: meetings [9, 10] and [10, 11] touch but never overlap, so 1 room is enough — an ending meeting frees its room first.
Medium · Hash Map · Strings
Read a failing service log and name the most frequent error code. For [500, 404, 500] the answer is 500 (seen twice); ties break to the smallest code string, so [404, 500] returns 404.
Medium · Greedy · Arrays
Play warehouse keeper: walk each order in turn, fulfill it if stock remains, and never let a skipped order block a later one. With stock 6 and orders [4, 2, 5]: 4 fits (2 left), 2 fits (0 left), 5 does not — [1, 1, 0].
Medium · Filtering · Arrays
Scrub a signup sheet, keeping rows with age 18-99 and ZIP 10000-99999, bounds inclusive. For ages [25, 17, 30] and ZIPs [12345, 90210, 999]: row 0 is valid, row 1's age fails, row 2's ZIP fails — [0].
Hard · Sweep Line · Intervals
Audit a room calendar with a capacity limit and flag every meeting past capacity, in sweep order. With capacity 1 and meetings [9, 11], [10, 12]: the second starts while the first still runs, so index 1 is flagged.