Skip to content

RESUMEWORLDS / ORIGINAL QUESTION LIBRARY

250 questions. A concrete next step.

200 coding exercises with authored examples and private grading cases, plus 50 system-design scenarios with constraints and failure rounds.

Download public question bank

Public links share question material. Your code, drafts, interview history, hidden tests and reference implementations stay private. Coding execution requires a configured isolated runner.

Editorial practice collections

Company-style preparation

Customize rounds for any company or role →

Original exercises mapped to public guidance. Company-style relevance does not mean a company asked these questions.

Company-style selections are editorial practice suggestions. View topics and source →

250 of 250 original questions

Coding / DSA · medium

Rolling request admission

Process nondecreasing request timestamps. Admit a request only if fewer than limit previously ADMITTED requests lie in (time - window, time]. Rejected requests do not consume capacity. Equal timestamps are distinct requests. Return the admitted count.

queuesliding-windowrate-limits
Coding / DSA · easy

Notification cooldown

Deliver the first notification for each user. Deliver another only when at least cooldown time has passed since that user’s last DELIVERED notification. Ignored notifications do not restart cooldown. Return the delivered count.

hash-mapdeduplication
Coding / DSA · easy

Unpaired event badge

At a campus hiring event every badge ID was scanned exactly twice, once at entry and once at exit, except for one badge that was scanned only once. Return that badge ID. Scans are not in any particular order.

bit-manipulationxorhash-map
Coding / DSA · easy

Balanced sprint pivot

Sprint story points are listed in order. Find the smallest zero-based index p such that the total of the points strictly before p equals the total strictly after p. An empty side totals 0. Return -1 if no such index exists.

prefix-sumarrays
Coding / DSA · easy

Skills shared by two sorted lists

A candidate skill list and a job requirement list are both given as skill codes in nondecreasing order, and codes may repeat. Match codes one-to-one: each occurrence can be matched with at most one equal occurrence in the other list. Return the largest number of matches.

two-pointerssorting
Coding / DSA · medium

Widest storage bay

Partitions stand at positions 0 to n-1 with given nonnegative heights. Choosing two partitions i < j forms a bay whose capacity is (j - i) multiplied by the shorter of the two heights; partitions between them are ignored. Return the largest capacity.

two-pointersgreedy
Coding / DSA · medium

Total booked calendar time

A shared calendar holds n bookings as half-open time ranges [start, end). Bookings may overlap, touch or be empty (start equals end). Return the total amount of time covered by at least one booking, counting overlapping time only once.

sortingintervals
Coding / DSA · medium

Split a digit run into bounded parts

An old attendance export glued p numbers together into one run of n decimal digits and lost the separators. Count the ways to cut the run into exactly p nonempty consecutive parts so that every part is a number from 0 to limit written without a leading zero. A part that is exactly 0 is allowed, but a part such as 05 is not.

recursionbacktrackingpartitions
Coding / DSA · medium

Agendas with limited nesting

A workshop agenda is a row of n opening markers and n closing markers. It is balanced when, reading left to right, the closings never outnumber the openings so far and both counts finish equal. Its depth is the largest number of markers that are open at the same moment. Count the balanced agendas with exactly n pairs whose depth is at most d.

recursionbacktrackingbalanced-sequencesmemoization
Coding / DSA · medium

Spread-out speaker order

Panel speakers are numbered 1 to n by seniority. A running order lists every speaker exactly once. To avoid back-to-back speakers of similar seniority, any two speakers who appear next to each other must have numbers that differ by at least d. Count the valid running orders.

recursionbacktrackingpermutations
Coding / DSA · medium

Distinct voucher collections

A campus store has n gift vouchers with positive values, and several vouchers can share a value. Each voucher can be used at most once. Count the different collections of voucher VALUES that add up exactly to the target. Two collections are the same when they contain every value the same number of times, no matter which physical vouchers were used.

recursionbacktrackingcombinationsdeduplication
Coding / DSA · hard

Guards on a partly blocked floor

An n by n office floor plan marks each desk as usable (0) or blocked (1). Place exactly n security guards on usable desks so that no two guards share a row, a column or either diagonal direction. Blocked desks cannot hold a guard but do not interrupt a line of sight. Count the valid placements.

recursionbacktrackingn-queens
Coding / DSA · hard

Shortest longest interviewer day

An interview coordinator has n interviews, each with a positive length in minutes, and k interviewers. Every interview goes to exactly one interviewer, in any combination, and an interviewer may receive none. An interviewer day length is the total minutes of their interviews. Return the smallest possible length of the longest interviewer day.

recursionbacktrackingminimise-maximumpruning
Coding / DSA · easy

Latest matching release

Release build numbers are stored in nondecreasing order, and the same build number can appear several times when a release was re-deployed. Return the zero-based index of the LAST occurrence of the target build number, or -1 when the target never appears.

binary-searchsorted-arraysupper-bound
Coding / DSA · easy

Largest cube of storage boxes

A warehouse planner wants to stack unit boxes into the largest solid cube possible using at most x boxes. Return the largest integer side length r ≥ 0 with r * r * r ≤ x. Solve it with integer arithmetic rather than a floating-point cube-root function.

binary-searcharithmeticsearch-on-answer
Coding / DSA · medium

Shrink the longest unsupported stretch

Help desks sit at strictly increasing integer positions along a training campus road. You may open at most k new desks at any integer positions. Return the smallest possible length of the longest stretch between neighbouring desks. Only the road between the first and last existing desk matters, and with a single desk the answer is 0.

binary-searchsearch-on-answerminimise-maximum
Coding / DSA · medium

Spread interviews apart

A recruiter has n open time slots, given as distinct integer minutes in no particular order, and must book exactly c interviews in c different slots. Choose the slots so that the smallest gap between any two booked interviews is as large as possible, and return that smallest gap.

binary-searchsearch-on-answergreedy
Coding / DSA · easy

The k-th skipped ticket number

Ticket numbers handed out at a career fair are positive and strictly increasing, but some numbers were skipped by the printer. Return the k-th smallest positive integer that does NOT appear in the list. Missing numbers can lie beyond the last ticket.

binary-searchsorted-arrayscounting
Coding / DSA · easy

Middle of a mentor chain

Mentors are linked in a chain: each node stores a mentor rating and the index of the next node. The chain order is the order reached from head by following next, which can differ from index order. Return the rating stored in the middle node of the chain. When the chain has an even number of nodes, use the second of the two middle nodes.

linked-listfast-slow-pointers
Coding / DSA · easy

Mirrored feedback chain

Feedback scores are stored as linked nodes, each holding a score and the index of the next node. Only the order reached by following next from head matters, not the index order. Print 1 if the scores read the same from head to tail as from tail to head, otherwise print 0.

linked-listpalindromein-place-reversal
Coding / DSA · medium

Length of a referral loop

A referral tracker stores n nodes, each holding only the index of the next node, or -1 when there is none. Start at the head node and keep following next. Either the walk reaches -1, or it eventually repeats nodes forever around a loop. Return the number of nodes in that loop, or 0 if the walk ends. Nodes that cannot be reached from head are ignored.

linked-listcycle-detectionfast-slow-pointers
Coding / DSA · medium

Reverse a span of a playlist chain

A learning playlist is a linked chain of lessons; each node stores a lesson code and the index of the next node. Reverse the order of the lessons at chain positions left through right (1-based positions along the chain, inclusive) and leave every other lesson where it is. Then return the checksum of the new chain: the sum over every position p of p times the lesson code at that position.

linked-listin-place-reversal
Coding / DSA · medium

Where two referral chains meet

Two referral chains live in one pool of n nodes, where each node stores only the index of its next node (-1 ends a chain). Chain A starts at headA and chain B starts at headB. Once the chains reach a common node they share every node after it. Return the index of the first node that belongs to both chains, or -1 if they never meet. If both heads are the same node, that node is the answer.

linked-listtwo-pointersintersection
Coding / DSA · hard

Reverse a chain in fixed-size groups

A sprint board stores task cards as a linked chain; each node holds a card value and the index of the next node. Walking from head, split the chain into consecutive groups of k cards. Reverse the order inside every complete group, and keep a final group of fewer than k cards in its original order. Return the checksum of the resulting chain: the sum over 1-based positions p of p times the card value at that position.

linked-listin-place-reversalpointer-manipulation
Coding / DSA · easy

Lowest score on a review stack

A reviewer keeps a stack of score cards and processes a log of operations. (1, x) pushes a card with score x. (2, 0) removes the top card if the stack is not empty and otherwise does nothing. (3, 0) asks for the lowest score currently on the stack. Return the sum of the answers to all lowest-score questions, where a question asked on an empty stack contributes 0. Aim for constant time per operation.

stackmin-stackdesign
Coding / DSA · easy

Course list with follow-on discounts

Courses are listed in order with integer prices. Each course is discounted by the price of the first course listed after it whose price is less than or equal to its own. A course with no such later course gets no discount. Return the total amount paid for all courses after the discounts.

stackmonotonic-stacknext-smaller
Coding / DSA · medium

Moves inside a two-stack ticket queue

A help desk runs its first-in-first-out ticket queue on two stacks, an inbox and an outbox. Adding a ticket pushes it onto the inbox. Serving a ticket pops the top of the outbox; if the outbox is empty at that moment, every ticket in the inbox is first popped and pushed onto the outbox, one ticket at a time. Serving when both stacks are empty does nothing. Return the total number of tickets moved from the inbox to the outbox over the whole log.

queuestacksimulationamortized-analysis
Coding / DSA · medium

Undo and redo in a notes editor

A notes editor holds a sequence of numbers and processes a log. (1, x) appends x to the end. (2, 0) undoes the most recent append that is still in effect, removing that number. (3, 0) redoes the most recently undone append, putting the number back at the end. Any new append clears the redo history, and an undo or redo with nothing available does nothing. Return the sum over the final sequence of each number times its 1-based position.

stackundo-redosimulation
Coding / DSA · medium

Last participant in the icebreaker circle

Participants numbered 1 to n stand in a circle for an icebreaker. Counting starts at participant 1 and moves around the circle; the participant who is counted k-th leaves, and counting restarts at 1 with the next remaining participant. Return the number of the last remaining participant.

queuesimulationrecursion
Coding / DSA · hard

Evaluate a bracketed scoring formula

A grading rubric stores an infix scoring formula as integer tokens. Tokens 0 to 100 are numbers; 101 means plus, 102 minus, 103 times, 104 an opening bracket and 105 a closing bracket. Multiplication binds tighter than plus and minus, operators of equal strength apply from left to right, and brackets group as usual. There is no unary minus. Return the value of the formula.

stackexpression-parsingoperator-precedence
Coding / DSA · easy

Busiest reporting level

A binary org chart stores a signed contribution score on every node. The root is level 0 and each child sits one level below its parent. Add up the scores on each level and return the largest level total. Scores can be negative, so the answer can be negative too.

treesbreadth-first-searchlevel-order
Coding / DSA · medium

Widest seating row in a binary chart

Imagine drawing a binary chart on a seating grid: the root takes slot 0 of its row, and a node in slot p places its left child in slot 2p and its right child in slot 2p+1 of the next row. The span of a row is (rightmost occupied slot - leftmost occupied slot + 1), so empty slots between occupied ones still count. Node values do not matter. Return the largest span over all rows.

treesbreadth-first-searchindexing
Coding / DSA · medium

Depth of the nearest shared manager

Two people, a and b, sit somewhere in a binary reporting tree. Their nearest shared manager is the deepest node that has both of them in its subtree; a node counts as part of its own subtree, so if a manages b the answer is a itself, and if a equals b it is that node. Return the depth (edges from the root) of that shared node.

treeslowest-common-ancestorparent-pointers
Coding / DSA · easy

Headcount at a reporting depth

A company hierarchy is given as a parent list, with the founder at node 0. Someone reporting directly to the founder is at depth 1, their reports are at depth 2, and so on. Return how many people sit at exactly depth k. If no one is that deep, return 0.

treesdepthcounting
Coding / DSA · easy

Evenly staffed binary chart

Call a binary chart evenly staffed when, at EVERY node, the heights of its left and right subtrees differ by at most 1. Height counts nodes on the longest downward path, and an empty subtree has height 0. Print 1 if the chart is evenly staffed, otherwise 0. Checking only the root is not enough.

treesrecursionheight
Coding / DSA · easy

Total of left-hand leaf nodes

In a binary chart, a left-hand leaf is a node with no children that is attached as the LEFT child of its parent. The root is never a left-hand leaf, even if it stands alone. Return the sum of values of all left-hand leaves, or 0 if there are none.

treestraversalleaves
Coding / DSA · hard

Downward chains with a target total

A downward chain starts at any node of a binary chart and follows child links downward to the same node or one of its descendants, so a single node is a chain on its own. Count the chains whose node values add up to exactly the target. Values may be negative or zero, so chains can overlap and still qualify.

treesprefix-sumhash-mapdepth-first-search
Coding / DSA · medium

Running k-th best assessment score

Assessment scores arrive one at a time. After each arrival, if at least k scores have arrived, note the k-th largest score seen so far; repeated scores count as separate entries. Return the sum of all noted values, or 0 if fewer than k scores ever arrive.

heappriority-queuestreaming
Coding / DSA · hard

Shortest-first job dispatcher

A single build agent runs jobs one at a time without interruption. Whenever it is idle and at least one job has arrived and is waiting, it starts the waiting job with the shortest duration; ties go to the earlier arrival, then to the smaller job index. If nothing is waiting, it stays idle until the next arrival. A job arriving exactly when the agent frees up is already waiting. Return the sum of all job completion times.

heapschedulingsimulation
Coding / DSA · medium

Readings nearest a calibration point

A sensor log holds n readings, possibly repeated. Rank readings by their distance |reading - x| from the calibration point x; among equal distances the smaller reading ranks first. Keep the k best-ranked readings (repeated readings are separate entries) and return their sum.

heappriority-queueselection
Coding / DSA · medium

Autocomplete match totals

A course catalogue stores n course codes, each a sequence of tokens; duplicate codes are separate courses. For each of q search queries, count the courses whose code starts with the query tokens (a code equal to the query counts). Return the sum of these counts over all queries.

trieprefix-countingqueries
Coding / DSA · hard

Shortest distinguishing code prefixes

For each code in a list, find the shortest prefix of it that no OTHER code in the list starts with. When no such prefix exists (the code duplicates another code, or is itself the start of a longer code), use the full code length instead. Return the sum of the chosen lengths over all codes.

trieprefix-countingstrings
Coding / DSA · easy

Count merged booking blocks

Room bookings are closed intervals [start, end] given in any order. Bookings that overlap, or that merely share an endpoint, join into one block, and blocks keep chaining as long as bookings connect. Bookings like [1,2] and [3,4] do not touch, so they stay separate. Return the number of blocks.

intervalssortingmerging
Coding / DSA · medium

Width after inserting a booking

A calendar holds closed, already-separated bookings sorted by start, where each booking starts after the previous one ends. A new closed booking [a, b] is added, and it merges with every booking it overlaps or shares an endpoint with, including bookings that only connect after earlier merges. Return the length (end - start) of the merged block that contains the new booking.

intervalsmerginglinear-scan
Coding / DSA · medium

Fewest review visit days

Each learner is available on a closed range of integer days [start, end]. A reviewer picks some visit days, and a learner is reviewed if at least one visit day falls inside their range; one visit can serve many learners. Return the fewest visit days that review every learner.

greedyintervalssorting
Coding / DSA · medium

Fewest leaps through a course ladder

Course modules stand in a row from 0 to n-1. Module i lets you advance to any module from i+1 to i+reach[i]; a reach of 0 means you cannot move forward from it. Starting at module 0, return the fewest moves needed to reach module n-1, or -1 if it cannot be reached. With a single module the answer is 0.

greedyarraysbreadth-first-search
Coding / DSA · medium

Most tasks matched to learners

Each learner has a skill level and each practice task has a difficulty. A learner may take a task only when their skill is at least the task difficulty, each learner takes at most one task, and each task goes to at most one learner. Return the largest number of tasks that can be assigned.

greedytwo-pointerssorting
Coding / DSA · easy

Recolour a desk zone

An office seating chart stores a team colour code in every cell. Repainting one cell also repaints every cell reachable from it through side-sharing neighbours that carry the same original colour. Return how many cells actually change colour; if the new colour equals the original colour, nothing changes and the answer is 0.

graphsgridsflood-fillbreadth-first-search
Coding / DSA · easy

Desks cut off from every exit

An office map marks staffed desks with 1 and walkways with 0. Desks link only through shared sides. A desk group touching any outer edge of the map has a way out. Count the desk cells that belong to groups with no cell on the outer edge.

graphsgridsdepth-first-searchboundary-search
Coding / DSA · easy

Knight hops across a club board

At the campus chess club a knight jumps two squares in one direction and then one square sideways. On a board of rows × cols squares, return the fewest jumps that take the knight from its start square to the target square without leaving the board. Return 0 when start and target coincide and -1 when the target can never be reached.

graphsbreadth-first-searchgrids
Coding / DSA · medium

Patch rollout minutes

Desks in an office grid hold 0 for an empty desk, 1 for a laptop still waiting for a security patch and 2 for a laptop that already has it. Every minute, each patched laptop passes the patch to waiting laptops directly above, below, left or right of it, all at the same time. Return the number of minutes until no laptop is waiting, 0 if none waits at the start, or -1 if some waiting laptop can never receive the patch.

graphsgridsmulti-source-bfsbreadth-first-search
Coding / DSA · medium

Count learning-plan routes

A learning plan is a directed graph in which every edge u→v satisfies u < v, so it never loops back. Count the distinct directed routes from milestone 0 to milestone n-1, modulo 1,000,000,007. Parallel edges between the same milestones form different routes. When n = 1 the empty route counts once.

graphsdagdynamic-programmingcounting
Coding / DSA · medium

Modules you can actually finish

A course catalogue has n modules and m prerequisite pairs (a,b) meaning module a must be finished before module b can begin. A module becomes finishable once every one of its prerequisites is finished. Return how many modules can eventually be finished. Modules inside a circular chain, or depending on one, never become finishable; a pair (a,a) blocks module a.

graphstopological-sortcycles
Coding / DSA · medium

Shortest route with diagonal steps

A floor plan marks open floor with 0 and furniture with 1. From an open cell you may step to any of the eight surrounding cells, diagonals included, as long as it is open. Return the fewest steps from the top-left cell to the bottom-right cell. Return 0 if they are the same open cell and -1 if either corner is furniture or no route exists.

graphsgridsbreadth-first-search
Coding / DSA · medium

First redundant network cable

Cables between n rooms are installed one at a time in the listed order. Return the 1-based position of the first cable whose two ends were already linked through earlier cables; a cable from a room to itself is always redundant. Return 0 if every cable links two previously separate groups.

graphsunion-findcycles
Coding / DSA · medium

Time for an announcement to reach everyone

An announcement starts at server s and travels along one-way links; a link (u,v,t) delivers it from u to v t milliseconds after u has it. Servers forward immediately. Return the moment the last server first receives the announcement, which is the largest of the shortest delivery times. Return -1 if some server never receives it; a lone server gives 0.

graphsdijkstraweighted-paths
Coding / DSA · hard

Gentlest hiking trail effort

A team offsite hiking map stores an altitude for each cell. A trail runs from the top-left cell to the bottom-right cell through side-adjacent cells. Its effort is the largest absolute altitude change between two consecutive cells along it, and a single-cell trail has effort 0. Return the smallest effort any trail can achieve.

graphsgridsdijkstraminimax-path
Coding / DSA · easy

Cheapest certification ladder climb

A certification ladder has n rungs numbered 0 to n-1, each with a fee. You may begin on rung 0 or rung 1 for free. Each move goes up one or two rungs, and you pay the fee of the rung you leave. Return the minimum total fee needed to reach position n, just above the last rung.

dynamic-programmingarrays
Coding / DSA · medium

Round-table mentor picks

n mentors sit around a round table, each with a non-negative rating. Invite mentors so that no two invited mentors sit side by side; seat n-1 sits beside seat 0. A lone mentor (n = 1) may be invited. Return the largest total rating of the invited mentors.

dynamic-programmingtake-or-skipcircular-arrays
Coding / DSA · medium

Ways to pay a stipend

An intern stipend of exactly total rupees is paid using notes of the given distinct denominations, with unlimited notes of each kind. Count the different collections of notes that pay it; the order in which notes are handed over does not matter. Return the count modulo 1,000,000,007. A total of 0 is paid in one way, with no notes.

dynamic-programmingunbounded-knapsackcounting
Coding / DSA · medium

Fewest sprint leaps

Sprint checkpoints are numbered 0 to n-1. From checkpoint i you may leap forward to any checkpoint from i+1 up to i+reach[i]. Return the fewest leaps needed to get from checkpoint 0 to checkpoint n-1, 0 when n = 1, or -1 if the last checkpoint cannot be reached.

dynamic-programminggreedyarrays
Coding / DSA · hard

Collapse a bonus chain

Positive bonus tokens stand in a row. Removing a token earns left × value × right, where left and right are the values of its nearest tokens still standing on each side, and a missing side counts as 1. Remove every token in any order you like and return the largest total earnings.

dynamic-programminginterval-dp
Coding / DSA · hard

Merge neighbouring report piles

Report piles stand in a row with given page counts. One step merges two NEIGHBOURING piles into a single pile in their place and costs the combined page count. Keep merging until one pile remains and return the minimum total cost. Because only neighbours may merge, the two smallest piles are not always available together.

dynamic-programminginterval-dpprefix-sum
Coding / DSA · hard

Longest rising skill trail

Every cell of a skill map holds a level. A trail moves between side-adjacent cells, and each step must go to a STRICTLY higher level. Return the number of cells on the longest possible trail; any single cell is a trail of length 1.

dynamic-programminggridsmemoizationdepth-first-search
Coding / DSA · hard

Fewest load-test trials

A service is stable up to some unknown load level L between 0 and n, and level 0 is always safe. Testing at level x crashes the test server exactly when x > L; a crashed server is lost, while a surviving one can test again. With k identical test servers, return the minimum number of tests that is guaranteed to pin down L in the worst case.

dynamic-programmingminimaxdecision-strategy