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.
- String778
- Randomized15
- Array1842
- Hash Table749
- Math565
- Dynamic Programming534
- Sorting483
- Greedy401
- Depth-First Search338
- Binary Search305
- Matrix267
- Breadth-First Search261
Algorithms & Data Structures · Greedy line packing and fiddly space math — full text justification.
Algorithms & Data Structures · Arbitrary-precision rounding — floats need not apply.
Algorithms & Data Structures · Reassemble lines from arbitrary chunks, reading lazily.
Decide Target via Subsequence Plus/Multiply Expression
Algorithms & Data Structures · Expression search with precedence — the (total, pending product) trick.
Algorithms & Data Structures · lower_bound on the prefix itself, then one startswith check.
Stateful Search Autocomplete Session
Algorithms & Data Structures · A typing session over search counts: top three by frequency, then alphabetically.
Algorithms & Data Structures · Parse (count, digit) pairs backward — adjacent runs must differ.
Algorithms & Data Structures · Tokenize into groups of choices, then fold a cartesian product across them.
Algorithms & Data Structures · Two-pointer scans with no library calls — the point is proving you can.
Algorithms & Data Structures · A tree of nodes keyed by path segment — the OOD-style prompt where the implementation is the test.
Algorithms & Data Structures · Greedy word wrap inside ASCII borders — never split a word, never start a line with punctuation.
Algorithms & Data Structures · Split first, decode second — the ordering that makes the encoded-ampersand case work.
Algorithms & Data Structures · Case-insensitive, longest match wins, original text preserved — a trie walk from every offset.
Algorithms & Data Structures · Parse, validate, count — and pick the right denominator for the failure rate.
Algorithms & Data Structures · One pass and O(k) memory: item i replaces a random slot with probability k/(i+1).
Algorithms & Data Structures · One pass with a stack of signed terms; the trap is integer division truncating toward zero.
Algorithms & Data Structures · Build the trie first and say why: it prunes the DFS the moment a prefix does not exist.
Algorithms & Data Structures · A 26-count key instead of sorting each word — the only decision in the problem.
Algorithms & Data Structures · BFS, not DFS — shortest path — then mention bidirectional BFS, which roughly square-roots the frontier.
Algorithms & Data Structures · The first character whose second occurrence comes earliest — one pass with a set, emoji included.
Algorithms & Data Structures · PUT, GET and a COUNT of everything under a domain: match on the label boundary, then make COUNT fast with a trie.
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 · Matches are contiguous: lower_bound the prefix, then the prefix bumped by one.
Algorithms & Data Structures · The reverse parse, memoized on (index, previous digit) — count, don't build.
Algorithms & Data Structures · Split, round each value with string arithmetic, join — floats need not apply.
Algorithms & Data Structures · Reassemble the lines, net the balances, then search for the fewest transfers.
Algorithms & Data Structures · A three-line grammar turns nested braces into a tiny recursive-descent parser.
Algorithms & Data Structures · Find the end of each run (or each number), emit, jump.
Algorithms & Data Structures · A read pointer and a write pointer over the same array — write never passes read.
Weighted Sampling Without Replacement
Algorithms & Data Structures · A-Res: key each item by random()^(1/weight) and keep the k largest keys.
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 · Buffer bytes across recv calls, split on newlines, and decode only whole lines.
Algorithms & Data Structures · Where the earliest second occurrence sits — the same set scan, returning an index.
Count Each Character in First-Seen Order
Algorithms & Data Structures · One counting pass into a Map, emitted in insertion order: AAABBAA becomes 5A2B.
Algorithms & Data Structures · Levels from the top down, one character per column — ground, water, or air.
Algorithms & Data Structures · Each sentence wraps at its own width; one box pads every line to the widest.
Algorithms & Data Structures · One register, a dictionary of recorded bodies, and a mode flag that says whether a line runs or is being stored.
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.
Algorithms & Data Structures · Two pointers per run: find where the run ends, reverse it in place, carry on from there.
Algorithms & Data Structures · Turn each match into a clipped line range, merge ranges that touch, and print a separator between the groups left.
Algorithms & Data Structures · Recursive descent with one cursor: a value function that dispatches on the next character, and a parser per kind.
Document Store With Boolean Queries
Algorithms & Data Structures · An inverted index plus a tiny expression parser whose values are sets of document ids.
Filter With a Dynamic Blacklist
Algorithms & Data Structures · Emitted items are final; held items wait in publish order and are re-checked whenever a word is unblocked.
Document Coverage: The Shortest Window
Algorithms & Data Structures · Minimum window over tokens: expand until every term is covered, shrink while it stays covered, keep the shortest.
Algorithms & Data Structures · A recursive-descent parser: a command's operand is either an integer or a parenthesised sub-program evaluated from zero.
Algorithms & Data Structures · Pre-order with explicit end-of-word marks and parentheses around children; parsing it back is a recursive descent.
Algorithms & Data Structures · The commands become a prefix grammar: an expression is an integer or (OP expr expr), evaluated by recursive descent over the tokens.
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 · Optional location, minimum-age and maximum-age constraints combined with AND or OR; an absent constraint is ignored, and no constraint matches everything.
Algorithms & Data Structures · Map each name to how many times it appears; the second warm-up of the data-science screen.
Algorithms & Data Structures · The Encrypt and Decrypt Strings variant the phone screen asks: return the dictionary words a ciphertext can decode to, not how many, by DFS with backtracking.
Algorithms & Data Structures · Count consonants as you scan, advance every nth one to the next consonant with wrap-around, and keep its case.
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 · Inside backticks, snake_case identifiers become camelCase and UPPER_CASE constants stay; everything else, including every space, is copied through.
Algorithms & Data Structures · Count pairs of numbers that are digit rotations of each other: give every number a canonical rotation and count equal keys instead of comparing pairs.
Reverse Words, Keeping the Spacing
Algorithms & Data Structures · Reverse the order of the words while every run of spaces stays exactly where it was, including leading and trailing runs.
All Valid Expansions of Wildcard Parentheses
Algorithms & Data Structures · The follow-up to the wildcard validity check: enumerate every distinct balanced string the stars can produce, pruning on the running balance.
Algorithms & Data Structures · Turn a map of arbitrary strings into one string and back. Any separator can appear in the data, so the format has to say where each field ends: length prefixes.
Asked on LeetCode
734 questions tagged Randomized or String · all time
- Valid ParentheseseasyStringStackBracket Sequences28 companies
- Group AnagramsmediumArrayHash TableStringSorting27 companies
- Longest Substring Without Repeating CharactersmediumHash TableStringSliding Window27 companies
- Text JustificationhardArrayStringSimulation26 companies
- Time Based Key-Value StoremediumHash TableStringBinary SearchDesign26 companies
- Insert Delete GetRandom O(1)mediumArrayHash TableMathDesign+124 companies
- Word LadderhardHash TableStringBreadth-First SearchBidirectional Search22 companies
- Minimum Window SubstringhardHash TableStringSliding Window21 companies
- Longest Palindromic SubstringmediumTwo PointersStringDynamic ProgrammingManacher21 companies
- String CompressionmediumTwo PointersString20 companies
- Basic Calculator IImediumMathStringStack19 companies
- Word SearchmediumArrayStringBacktrackingDepth-First Search+119 companies
- Basic CalculatorhardMathStringStackRecursion17 companies
- Decode StringmediumStringStackRecursion17 companies
- Implement Trie (Prefix Tree)mediumHash TableStringDesignTrie17 companies
- Random Pick with WeightmediumArrayMathBinary SearchPrefix Sum+116 companies
- String to Integer (atoi)mediumString16 companies
- Alien DictionaryhardArrayStringDepth-First SearchBreadth-First Search+316 companies
- Letter Combinations of a Phone NumbermediumHash TableStringBacktracking16 companies
- Evaluate DivisionmediumArrayStringDepth-First SearchBreadth-First Search+515 companies
- Top K Frequent WordsmediumArrayHash TableStringTrie+415 companies
- Integer to RomanmediumHash TableMathString15 companies
- Longest Common PrefixeasyArrayStringTrie15 companies
- Generate ParenthesesmediumStringDynamic ProgrammingBacktrackingBracket Sequences15 companies
- Accounts MergemediumArrayHash TableStringDepth-First Search+315 companies
- Find the Length of the Longest Common PrefixmediumArrayHash TableStringTrie14 companies
- Roman to IntegereasyHash TableMathString14 companies
- Word BreakmediumArrayHash TableStringDynamic Programming+314 companies
- Regular Expression MatchinghardStringDynamic ProgrammingRecursion14 companies
- Word Break IIhardArrayHash TableStringDynamic Programming+314 companies
- Word Search IIhardArrayStringBacktrackingTrie+114 companies
- Serialize and Deserialize Binary TreehardStringTreeDepth-First SearchBreadth-First Search+214 companies
- Integer to English WordshardMathStringRecursion13 companies
- Reconstruct ItineraryhardArrayStringDepth-First SearchGraph Theory+513 companies
- Search Suggestions SystemmediumArrayStringBinary SearchTrie+213 companies
- Simplify PathmediumStringStack13 companies
- Valid Palindrome IIeasyTwo PointersStringGreedy13 companies
- Palindromic SubstringsmediumTwo PointersStringDynamic Programming13 companies
- Reorganize StringmediumHash TableStringGreedySorting+213 companies
- Valid PalindromeeasyTwo PointersString13 companies
- Valid AnagrameasyHash TableStringSorting13 companies
- Longest Repeating Character ReplacementmediumHash TableStringSliding Window13 companies
- Design Add and Search Words Data StructuremediumStringDepth-First SearchDesignTrie12 companies
- Valid Parenthesis StringmediumStringDynamic ProgrammingStackGreedy+112 companies
- Open the LockmediumArrayHash TableStringBreadth-First Search+112 companies
- Design Search Autocomplete SystemhardStringDepth-First SearchDesignTrie+312 companies
- Word Ladder IIhardHash TableStringBacktrackingBreadth-First Search+112 companies
- Multiply StringsmediumMathStringSimulation11 companies
- Wildcard MatchinghardStringDynamic ProgrammingGreedyRecursion11 companies
- Reverse Words in a StringmediumTwo PointersString11 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.