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.
- Dynamic Programming534
- Breadth-First Search261
- Stack170
- Array1842
- String778
- Hash Table749
- Math565
- Sorting483
- Greedy401
- Depth-First Search338
- Binary Search305
- Matrix267
Collect Pins from Reachable Boards
Algorithms & Data Structures · BFS over the bipartite pin-board graph without building board-to-board edges.
Compute Reachable Cells for a Cleaning Robot
Algorithms & Data Structures · Slide-until-blocked physics: rest positions are the states, not cells.
Implement Single-Tab Browser History Navigation
Algorithms & Data Structures · A cursor over one visit stack: truncate forward history, clamp at both ends.
Algorithms & Data Structures · BFS over routes, not stops — clear each stop as you expand it.
Algorithms & Data Structures · Two out-edges per index: a graph search with a visited array.
Count Objects in a Pixel Grid via an API
Algorithms & Data Structures · Flood fill through an opaque API — isSameObject is the catch.
Algorithms & Data Structures · Open roads cost 0, closed cost 1 — textbook 0-1 BFS.
Shortest Path Around Obstacles
Algorithms & Data Structures · Unit steps on a grid: BFS, and the first arrival is the answer.
Algorithms & Data Structures · Unbounded knapsack in disguise — say that out loud, then roll a 1-D table.
Algorithms & Data Structures · An undo log per open transaction: rollback replays it, commit hands it to the parent.
Algorithms & Data Structures · Cycle detection dressed up as a scheduling question.
Algorithms & Data Structures · Flood fill from every unvisited land cell — and know when DFS, BFS or union-find fits.
Algorithms & Data Structures · Flatten behind hasNext/next with O(depth) memory — and survive [[], [[]], [[], [3]]].
Algorithms & Data Structures · One pass with a stack of signed terms; the trap is integer division truncating toward zero.
Algorithms & Data Structures · A group dies exactly when it has no adjacent empty point — flood fill each neighbouring enemy group.
Algorithms & Data Structures · Two-colour with BFS from every unvisited node; an odd cycle is the only way to fail.
Algorithms & Data Structures · BFS, not DFS — shortest path — then mention bidirectional BFS, which roughly square-roots the frontier.
Algorithms & Data Structures · A second stack holds the minimum at each depth, so getMin is just its top.
Algorithms & Data Structures · BFS from the start: the layer where the last index appears is the answer.
Algorithms & Data Structures · The reverse parse, memoized on (index, previous digit) — count, don't build.
Algorithms & Data Structures · A three-line grammar turns nested braces into a tiny recursive-descent parser.
Algorithms & Data Structures · Kahn's algorithm: peel sensors with no pending inputs; leftovers mean a cycle.
Algorithms & Data Structures · The rod-cutting table again, charging for every cut and seeding the whole-rod sale.
Algorithms & Data Structures · Add a piece-count dimension: dp[k][L] builds on dp[k − 1][L − p].
Nearest Bathroom for Every Desk
Algorithms & Data Structures · Seed the queue with every bathroom and expand once — one BFS for the whole floor, not one per desk.
Algorithms & Data Structures · Nearest-cake greedy is wrong; with both lists sorted, an optimal matching never crosses, so a 2-D DP finds it.
Algorithms & Data Structures · Courses run in waves, and a wave takes as long as its slowest course.
Algorithms & Data Structures · BFS over an implicit graph, fetching each page exactly once.
Algorithms & Data Structures · Store one predecessor per page, not a path per queue entry, and walk it back from the target.
Algorithms & Data Structures · A BFS that keeps going after the target is gone — and the thread-safety story that comes with it.
Algorithms & Data Structures · A course may start once any one prerequisite is done: swap the max for a min and relax in topological order.
Algorithms & Data Structures · A deleted node hands its children to its nearest surviving ancestor, so it simply adds no level.
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.
Fewest Coins When Change Is Given
Algorithms & Data Structures · Overpaying can save coins: minimise coins handed over plus coins handed back, over every payment up to one large coin above the price.
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.
Pre-Order Traversal Skipping Marked Nodes
Algorithms & Data Structures · A pre-order walk with a stack; a marked node is dropped before its children are pushed, so its whole subtree disappears.
Algorithms & Data Structures · A queue with an index pointer, a visited set marked on enqueue, neighbours in the order given.
Algorithms & Data Structures · Deleting a node takes its subtree: walk down from the root, never entering a deleted node, and keep the deepest level reached.
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 · Kahn's algorithm with a min-heap in place of the queue: in-degrees, a frontier of ready nodes, and an empty result when a node never becomes ready.
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.
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.
Binary Tree Maximum Path Sum, With the Path
Algorithms & Data Structures · The maximum path sum is the warm-up; the follow-up wants the nodes on the path, which means recording which arm each node extends and stitching two arms together at the best bend.
Heaviest Set of Non-Adjacent Nodes
Algorithms & Data Structures · House Robber on an arbitrary small graph: with at most 20 nodes, a dynamic programme over subsets decides, for the lowest remaining node, take it and drop its neighbours or skip it.
Algorithms & Data Structures · Number of Islands where the top edge touches the bottom and the left edge touches the right: wrap the neighbour arithmetic, then discuss union-find and cell flips.
Asked on LeetCode
882 questions tagged Stack or Breadth-First Search or Dynamic Programming · all time
- Number of IslandsmediumArrayDepth-First SearchBreadth-First SearchUnion-Find+136 companies
- Trapping Rain WaterhardArrayTwo PointersDynamic ProgrammingStack+128 companies
- Valid ParentheseseasyStringStackBracket Sequences28 companies
- Rotting OrangesmediumArrayBreadth-First SearchMatrix26 companies
- Course Schedule IImediumDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort25 companies
- Best Time to Buy and Sell StockeasyArrayDynamic Programming24 companies
- Course SchedulemediumDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort+123 companies
- Word LadderhardHash TableStringBreadth-First SearchBidirectional Search22 companies
- Longest Palindromic SubstringmediumTwo PointersStringDynamic ProgrammingManacher21 companies
- House RobbermediumArrayDynamic Programming20 companies
- Basic Calculator IImediumMathStringStack19 companies
- Maximal SquaremediumArrayDynamic ProgrammingMatrix18 companies
- Maximum SubarraymediumArrayDivide and ConquerDynamic Programming18 companies
- Asteroid CollisionmediumArrayStackSimulation17 companies
- Basic CalculatorhardMathStringStackRecursion17 companies
- Decode StringmediumStringStackRecursion17 companies
- Coin ChangemediumArrayDynamic ProgrammingBreadth-First SearchKnapsack Problem+117 companies
- Binary Tree Maximum Path SumhardDynamic ProgrammingTreeDepth-First SearchBinary Tree+117 companies
- Min StackmediumStackDesign17 companies
- Largest Rectangle in HistogramhardArrayStackMonotonic StackRange Minimum/Maximum Query17 companies
- Alien DictionaryhardArrayStringDepth-First SearchBreadth-First Search+316 companies
- Climbing StairseasyMathDynamic ProgrammingMemoization16 companies
- Evaluate DivisionmediumArrayStringDepth-First SearchBreadth-First Search+515 companies
- Maximum Profit in Job SchedulinghardArrayBinary SearchDynamic ProgrammingSorting15 companies
- Generate ParenthesesmediumStringDynamic ProgrammingBacktrackingBracket Sequences15 companies
- Accounts MergemediumArrayHash TableStringDepth-First Search+315 companies
- Best Time to Buy and Sell Stock IImediumArrayDynamic ProgrammingGreedy14 companies
- Clone GraphmediumHash TableDepth-First SearchBreadth-First SearchGraph Theory14 companies
- Word BreakmediumArrayHash TableStringDynamic Programming+314 companies
- Regular Expression MatchinghardStringDynamic ProgrammingRecursion14 companies
- Word Break IIhardArrayHash TableStringDynamic Programming+314 companies
- Making A Large IslandhardArrayDepth-First SearchBreadth-First SearchUnion-Find+114 companies
- Longest Increasing SubsequencemediumArrayBinary SearchDynamic ProgrammingLongest Increasing Subsequence14 companies
- Serialize and Deserialize Binary TreehardStringTreeDepth-First SearchBreadth-First Search+214 companies
- Flatten Nested List IteratormediumStackTreeDepth-First SearchDesign+213 companies
- Shortest BridgemediumArrayDepth-First SearchBreadth-First SearchMatrix13 companies
- Simplify PathmediumStringStack13 companies
- Palindromic SubstringsmediumTwo PointersStringDynamic Programming13 companies
- Non-overlapping IntervalsmediumArrayDynamic ProgrammingGreedySorting13 companies
- Shortest Path in Binary MatrixmediumArrayBreadth-First SearchMatrix13 companies
- Max Area of IslandmediumArrayDepth-First SearchBreadth-First SearchUnion-Find+113 companies
- Shortest Path in a Grid with Obstacles EliminationhardArrayBreadth-First SearchMatrix13 companies
- House Robber IImediumArrayDynamic Programming13 companies
- Jump GamemediumArrayDynamic ProgrammingGreedy13 companies
- Maximum Product SubarraymediumArrayDynamic Programming13 companies
- Jump Game IImediumArrayDynamic ProgrammingGreedy13 companies
- Unique PathsmediumMathDynamic ProgrammingCombinatorics13 companies
- Binary Tree Zigzag Level Order TraversalmediumTreeBreadth-First SearchBinary Tree13 companies
- Design Browser HistorymediumArrayLinked ListStackDesign+212 companies
- Evaluate Reverse Polish NotationmediumArrayMathStack12 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.