Problems
Callback's own problems and the LeetCode questions companies have been asking, in one place — pick a category, then filter by company, frequency, status, difficulty, topic, and language.
- Math565
- Sorting483
- Eulerian Circuit5
- Array1842
- String778
- Hash Table749
- Dynamic Programming534
- Greedy401
- Depth-First Search338
- Binary Search305
- Matrix267
- Breadth-First Search261
Algorithms & Data Structures · Arbitrary-precision rounding — floats need not apply.
Algorithms & Data Structures · Order and duplicates vanish at every depth — canonicalize.
Algorithms & Data Structures · Interval sweep for the free ranges — independent of bucket-space size.
Cross-Reference Logs to Flag Spam Numbers
Algorithms & Data Structures · A hash join across two logs — and saying that word out loud.
Maximize Boxes Stored Through One Entrance
Algorithms & Data Structures · Prefix-min ceilings plus an exchange-argument greedy.
Algorithms & Data Structures · Net the balances, then match debtors to creditors greedily.
Algorithms & Data Structures · Use every ticket once: Hierholzer's walk, smallest destination first.
Restaurant Seating: Free Intervals
Algorithms & Data Structures · A +ppl/−ppl sweep; occupancy is constant between events.
Count Pins on a Two-Column Screen
Algorithms & Data Structures · Only n scroll offsets matter — slide the window to a pin's top.
Stateful Search Autocomplete Session
Algorithms & Data Structures · A typing session over search counts: top three by frequency, then alphabetically.
Algorithms & Data Structures · Sort both teams, pair i-th against i-th, and try both orders.
Algorithms & Data Structures · The largest nearest-sensor gap — sort one side, binary search from the other.
Algorithms & Data Structures · Interval greedy: extend coverage with the farthest-reaching clip that still connects.
Algorithms & Data Structures · Consume the oldest stock first and say which lots an order drew from — an implementation prompt with tie-break rules.
Memory-Bounded Ranked Ballot Counter
Algorithms & Data Structures · Millions of ballots, Borda scoring, and memory that stays O(candidates) — the constraint is the question.
Algorithms & Data Structures · Bucket sort when the multiset fits, a size-N heap when it's a stream — say both.
Algorithms & Data Structures · "Bidirectional and transitive" means connected components — union-find, keyed by the smallest word.
Algorithms & Data Structures · One DFS from the base unit multiplies factors down the tree, modulo a prime.
Nth Node at Level L in a 0/1 Tree
Algorithms & Data Structures · Never build the tree — halve recursively, or read the answer off the parity of popcount(n − 1).
Algorithms & Data Structures · One pass and O(k) memory: item i replaces a random slot with probability k/(i+1).
Algorithms & Data Structures · Two heaps — a max-heap for the lower half, a min-heap for the upper — rebalanced on every add.
Algorithms & Data Structures · Three guarded divisions — and 0 wherever a denominator is 0.
Algorithms & Data Structures · Map, combine, partition, sort, reduce — the three parts a groupby does not have are the whole grade.
Algorithms & Data Structures · One pass with a stack of signed terms; the trap is integer division truncating toward zero.
Algorithms & Data Structures · Sort, then sweep — the pattern behind a dozen calendar problems.
Algorithms & Data Structures · A 26-count key instead of sorting each word — the only decision in the problem.
Parse an Integer Without parseInt
Algorithms & Data Structures · Sign, then digits through a lookup table, accumulating n * 10 + d — and NaN for anything else.
Algorithms & Data Structures · Rebuild the itinerary with Hierholzer's walk, then look for a repeat.
Algorithms & Data Structures · Split, round each value with string arithmetic, join — floats need not apply.
Algorithms & Data Structures · Only faced pairs matter: greedily match the smaller team into the larger.
Algorithms & Data Structures · The greedy match, written into two rows with empty slots.
Fewest Towers to Cover Every Crossing
Algorithms & Data Structures · Greedy: place each tower as far right as the leftmost uncovered crossing allows.
Algorithms & Data Structures · One formula for every dimension: the square root of the summed squared differences.
Algorithms & Data Structures · The farthest-reach greedy again, remembering which clip won each round.
Algorithms & Data Structures · Sweep sorted clips tracking the farthest end; a start past it opens a gap.
Algorithms & Data Structures · Sort by (entity, time), then extend or open one session per entity in a single sweep.
Algorithms & Data Structures · Convert through the base unit — and divide with a modular inverse, since you can't divide mod p.
Algorithms & Data Structures · Store (tokens, last seen) per key and refill lazily on each call — O(1) per key.
Stratified Sampling with Largest-Remainder Allocation
Algorithms & Data Structures · Floor each proportional share, give leftovers to the largest remainders, sample within each stratum.
Algorithms & Data Structures · Discount each graded relevance by log2(position + 2), then divide by the ideal ordering's DCG.
Algorithms & Data Structures · Observed agreement corrected for the agreement two annotators would reach by chance.
Algorithms & Data Structures · 1 − C(n − c, k) / C(n, k), computed as a running product so nothing overflows.
Algorithms & Data Structures · Binary long multiplication: add the doubled multiple for every set bit — and double with +=, not a 32-bit shift.
Algorithms & Data Structures · Each position multiplies its two successors, wrapping around the end with modular indices.
Algorithms & Data Structures · A base case at n <= 0 and one recursive call — then say where the call stack runs out.
Algorithms & Data Structures · Binary-search the root in [0, max(1, x)] for a fixed number of rounds — an epsilon loop never ends for large x.
Algorithms & Data Structures · An infinite generator over two BigInts — ordinary numbers lose precision past the 78th term.
Algorithms & Data Structures · Per-client (tokens, last seen), a tier config read on every call, and an explicit fallback for clients with no valid tier.
Top K Search Terms, One Vote per User
Algorithms & Data Structures · Dedupe (user, term) pairs before counting, then sort by count with the term as the tie-break.
Top K Selling Books After Each Sale
Algorithms & Data Structures · Totals in a map; the top K is recomputed from the map on each update, or kept in a bounded structure when K is small and the catalogue huge.
Algorithms & Data Structures · Dutch national flag with three pointers, using only getColor and swap — one pass, no counting.
Most Credits With at Most K Classes
Algorithms & Data Structures · Weighted interval scheduling with a count budget: sort by end, binary-search the compatible predecessor, add a dimension for the cap.
Algorithms & Data Structures · Meeting rooms with stations: a bus is reusable only where it arrived, so keep the idle buses per station.
Pick the Query Type That Maximises Revenue
Algorithms & Data Structures · Committing to one type, you run it floor(k / duration) times; score every type and keep the best, earliest on ties.
Reach a Target With +2, Double and Halve
Algorithms & Data Structures · Any sequence counts, so think constructively: +2 keeps parity, doubling then +2s then halving shifts it, and halving is how you get smaller.
Algorithms & Data Structures · Split in half, sort each half, merge with two indices — stable, O(n log n), and the merge is the whole interview.
Algorithms & Data Structures · One person, every cake: scan the grid once keeping the cake with the smallest Manhattan distance.
Algorithms & Data Structures · Iterate the digit-square sum until a value repeats; the loop is the path from that value's first visit, and a happy number's loop is just [1].
Algorithms & Data Structures · One memo shared across every start: each value on a walk inherits the answer of where the walk stopped, so no value is followed twice.
Algorithms & Data Structures · Runways are workers and flights are tasks: a heap of free times hands each flight, in start order, to the runway that frees up first.
Rank Vectors by Cosine Similarity
Algorithms & Data Structures · Score every candidate against the query, keep the indices with the scores, sort descending; the zero vector needs a defined answer.
When Do the Chasing Points Meet?
Algorithms & Data Structures · N points in a cycle each move at unit speed toward the next one; simulate with a step small enough that the meeting time is right to the hundredth.
Transition Graph From Access Logs
Algorithms & Data Structures · Sort each user's accesses into a path from START to END, count transitions per source, and turn the counts into probabilities.
Top N Matches From a Constant-Time Score
Algorithms & Data Structures · P candidates, an O(1) score, N much smaller than P: a min-heap of size N beats sorting, in time and in space.
Validated Add-Subtract Calculator
Algorithms & Data Structures · Evaluate digits joined by + and - only after proving the string is well formed: no stray characters, no leading zeros, no doubled operators, and everything inside 32 bits.
Largest Number Below a Limit From Allowed Digits
Algorithms & Data Structures · Keep the limit's prefix as long as possible, step one digit down, then fill with the largest allowed digit; fall back to a shorter number, and mind leading zeros.
Algorithms & Data Structures · Each hour fished lowers a pond's next yield by one. The heap greedy is the first answer; the accepted one finds the water line all ponds are fished down to and sums arithmetic series.
Count Alternating-Parity Subarrays
Algorithms & Data Structures · Count the subarrays in which neighbours always differ in parity: the number ending at each index is the length of the current alternating streak.
Algorithms & Data Structures · For every concentric ring, collect the values clockwise from the ring's top-left corner, sort them, and write them back in the same order; single-row and single-column centres are the trap.
Asked on LeetCode
924 questions tagged Eulerian Circuit or Math or Sorting · all time
- Merge IntervalsmediumArraySortingQuicksort45 companies
- Group AnagramsmediumArrayHash TableStringSorting27 companies
- Find Median from Data StreamhardTwo PointersDesignSortingHeap (Priority Queue)+126 companies
- Top K Frequent ElementsmediumArrayHash TableDivide and ConquerSorting+425 companies
- Insert Delete GetRandom O(1)mediumArrayHash TableMathDesign+124 companies
- Meeting Rooms IImediumArrayTwo PointersGreedySorting+224 companies
- Basic Calculator IImediumMathStringStack19 companies
- Kth Largest Element in an ArraymediumArrayDivide and ConquerSortingHeap (Priority Queue)+119 companies
- Add Two NumbersmediumLinked ListMathRecursion18 companies
- 3SummediumArrayTwo PointersSorting18 companies
- Basic CalculatorhardMathStringStackRecursion17 companies
- Rotate ImagemediumArrayMathMatrix17 companies
- Random Pick with WeightmediumArrayMathBinary SearchPrefix Sum+116 companies
- Climbing StairseasyMathDynamic ProgrammingMemoization16 companies
- Task SchedulermediumArrayHash TableGreedySorting+216 companies
- Maximum Profit in Job SchedulinghardArrayBinary SearchDynamic ProgrammingSorting15 companies
- Top K Frequent WordsmediumArrayHash TableStringTrie+415 companies
- Integer to RomanmediumHash TableMathString15 companies
- Merge Sorted ArrayeasyArrayTwo PointersSorting15 companies
- Accounts MergemediumArrayHash TableStringDepth-First Search+315 companies
- Roman to IntegereasyHash TableMathString14 companies
- Sqrt(x)easyMathBinary SearchNewton's Method14 companies
- Find K Closest ElementsmediumArrayTwo PointersBinary SearchSliding Window+214 companies
- Integer to English WordshardMathStringRecursion13 companies
- Reconstruct ItineraryhardArrayStringDepth-First SearchGraph Theory+513 companies
- Search Suggestions SystemmediumArrayStringBinary SearchTrie+213 companies
- Reorganize StringmediumHash TableStringGreedySorting+213 companies
- Non-overlapping IntervalsmediumArrayDynamic ProgrammingGreedySorting13 companies
- Pow(x, n)mediumMathRecursion13 companies
- Valid AnagrameasyHash TableStringSorting13 companies
- Sort ColorsmediumArrayTwo PointersSortingQuicksort+113 companies
- Unique PathsmediumMathDynamic ProgrammingCombinatorics13 companies
- Evaluate Reverse Polish NotationmediumArrayMathStack12 companies
- Happy NumbereasyHash TableMathTwo PointersFloyd's Cycle Finding Algorithm12 companies
- K Closest Points to OriginmediumArrayMathDivide and ConquerGeometry+412 companies
- Max Points on a LinehardArrayHash TableMathGeometry+212 companies
- Design Search Autocomplete SystemhardStringDepth-First SearchDesignTrie+312 companies
- Multiply StringsmediumMathStringSimulation11 companies
- Squares of a Sorted ArrayeasyArrayTwo PointersSorting11 companies
- Employee Free TimehardArraySweep LineSortingHeap (Priority Queue)11 companies
- Longest String ChainmediumArrayHash TableTwo PointersString+210 companies
- Special Binary StringhardStringDivide and ConquerSorting10 companies
- Design In-Memory File SystemhardHash TableStringDesignTrie+110 companies
- Kth Smallest Element in a Sorted MatrixmediumArrayBinary SearchSortingHeap (Priority Queue)+110 companies
- Vertical Order Traversal of a Binary TreehardHash TableTreeDepth-First SearchBreadth-First Search+210 companies
- Insert Delete GetRandom O(1) - Duplicates allowedhardArrayHash TableMathDesign+110 companies
- Fizz BuzzeasyMathStringSimulation10 companies
- Contains DuplicateeasyArrayHash TableSorting10 companies
- Maximum Number of Events That Can Be AttendedmediumArrayGreedySortingHeap (Priority Queue)10 companies
- 4SummediumArrayTwo PointersSorting10 companies
Listings only — titles, difficulty, and tags link out to LeetCode. Imported from the leetcode-company-wise-problems snapshot dated 1 June 2025. Frequency is that dataset's own relative score within a company and time range.