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
- Binary Search305
- Enumeration107
- Array1842
- String778
- Hash Table749
- Dynamic Programming534
- Sorting483
- Greedy401
- Depth-First Search338
- Matrix267
- Breadth-First Search261
Algorithms & Data Structures · Arbitrary-precision rounding — floats need not apply.
Algorithms & Data Structures · Two sorted indexes and a binary search you write by hand.
Count Pins on a Two-Column Screen
Algorithms & Data Structures · Only n scroll offsets matter — slide the window to a pin's top.
Algorithms & Data Structures · lower_bound on the prefix itself, then one startswith check.
Algorithms & Data Structures · The largest nearest-sensor gap — sort one side, binary search from the other.
Algorithms & Data Structures · Tokenize into groups of choices, then fold a cartesian product across them.
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 · Three guarded divisions — and 0 wherever a denominator is 0.
Algorithms & Data Structures · Half-open intervals per room, only neighbours can clash — and check-then-book must be one atomic step.
Algorithms & Data Structures · One pass with a stack of signed terms; the trap is integer division truncating toward zero.
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 · The count served by time T is monotone — binary search T.
Algorithms & Data Structures · Matches are contiguous: lower_bound the prefix, then the prefix bumped by one.
Algorithms & Data Structures · Split, round each value with string arithmetic, join — floats need not apply.
Algorithms & Data Structures · One formula for every dimension: the square root of the summed squared differences.
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.
Algorithms & Data Structures · Timestamps arrive in order, so each type's list is already sorted and a count is two binary searches.
Key-Value Store With Prefix Scan
Algorithms & Data Structures · A hash map for the point operations and a sorted key list for the scan — agree the smallest version, then extend.
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.
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.
Repeated Lookups in a Sorted Array
Algorithms & Data Structures · Many queries against one sorted array: record each value's first index once and answer every query from that, never searching twice.
Algorithms & Data Structures · One person, every cake: scan the grid once keeping the cake with the smallest Manhattan distance.
Algorithms & Data Structures · A table that resets to zero on a mismatch, so the answer is the largest cell rather than the corner, and one row of it is enough.
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.
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.
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.
More Than a Third in a Sorted Array
Algorithms & Data Structures · In a sorted array a value that fills more than a third must cover the index at n/3 or at 2n/3, so two probes and four binary searches replace the scan.
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.
Asked on LeetCode
858 questions tagged Enumeration or Math or Binary Search · all time
- Time Based Key-Value StoremediumHash TableStringBinary SearchDesign26 companies
- Insert Delete GetRandom O(1)mediumArrayHash TableMathDesign+124 companies
- Median of Two Sorted ArrayshardArrayBinary SearchDivide and Conquer21 companies
- Koko Eating BananasmediumArrayBinary Search21 companies
- Search in Rotated Sorted ArraymediumArrayBinary Search20 companies
- Basic Calculator IImediumMathStringStack19 companies
- Add Two NumbersmediumLinked ListMathRecursion18 companies
- Design Hit CountermediumArrayBinary SearchDesignQueue+118 companies
- Find First and Last Position of Element in Sorted ArraymediumArrayBinary Search18 companies
- Basic CalculatorhardMathStringStackRecursion17 companies
- Rotate ImagemediumArrayMathMatrix17 companies
- Random Pick with WeightmediumArrayMathBinary SearchPrefix Sum+116 companies
- Find Peak ElementmediumArrayBinary Search16 companies
- Climbing StairseasyMathDynamic ProgrammingMemoization16 companies
- Maximum Profit in Job SchedulinghardArrayBinary SearchDynamic ProgrammingSorting15 companies
- Integer to RomanmediumHash TableMathString15 companies
- Roman to IntegereasyHash TableMathString14 companies
- Snapshot ArraymediumArrayHash TableBinary SearchDesign+114 companies
- Longest Increasing SubsequencemediumArrayBinary SearchDynamic ProgrammingLongest Increasing Subsequence14 companies
- Sqrt(x)easyMathBinary SearchNewton's Method14 companies
- Find K Closest ElementsmediumArrayTwo PointersBinary SearchSliding Window+214 companies
- Integer to English WordshardMathStringRecursion13 companies
- Search Suggestions SystemmediumArrayStringBinary SearchTrie+213 companies
- Pow(x, n)mediumMathRecursion13 companies
- Max Consecutive Ones IIImediumArrayBinary SearchSliding WindowPrefix Sum13 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
- Subarray Product Less Than KmediumArrayBinary SearchSliding WindowPrefix Sum12 companies
- Find the Duplicate NumbermediumArrayTwo PointersBinary SearchBit Manipulation+212 companies
- Multiply StringsmediumMathStringSimulation11 companies
- Search a 2D MatrixmediumArrayBinary SearchMatrix11 companies
- Find Minimum in Rotated Sorted ArraymediumArrayBinary Search11 companies
- Minimum Size Subarray SummediumArrayBinary SearchSliding WindowPrefix Sum11 companies
- Capacity To Ship Packages Within D DaysmediumArrayBinary Search10 companies
- Kth Smallest Element in a Sorted MatrixmediumArrayBinary SearchSortingHeap (Priority Queue)+110 companies
- Block Placement QuerieshardArrayBinary SearchBinary Indexed TreeSegment Tree+110 companies
- Single Element in a Sorted ArraymediumArrayBinary Search10 companies
- My Calendar ImediumArrayBinary SearchDesignSegment Tree+110 companies
- Insert Delete GetRandom O(1) - Duplicates allowedhardArrayHash TableMathDesign+110 companies
- Fizz BuzzeasyMathStringSimulation10 companies
- Split Array Largest SumhardArrayBinary SearchDynamic ProgrammingGreedy+110 companies
- Search a 2D Matrix IImediumArrayBinary SearchDivide and ConquerMatrix10 companies
- Count PrimesmediumArrayMathEnumerationNumber Theory+310 companies
- Two Sum II - Input Array Is SortedmediumArrayTwo PointersBinary Search10 companies
- Missing NumbereasyArrayHash TableMathBinary Search+210 companies
- Intersection of Two ArrayseasyArrayHash TableTwo PointersBinary Search+19 companies
- Best Meeting PointhardArrayMathSortingMatrix9 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.