Practice

DSA Problems

Start with Big-O, then solve 50 interview problems across 8 topics, in an order where each topic builds on the last. Every problem gets a write-up: the intuition, a diagram, brute force to optimal, and code.

50 problems8 topics14 easy34 medium2 hard

Topics

Eight topics, in learning order. Each one builds on the one before.

  1. 01 · 10 problems

    Arrays, Strings and Hashing

    The basics everything else builds on: scanning arrays and strings, two pointers, sliding windows, and hash maps for instant lookups.

  2. 02 · 5 problems

    Linked Lists

    A linked list stores data in nodes, each one linked to the next. Here you learn to add and remove nodes and rewire their links.

  3. 03 · 7 problems

    Stacks, Queues and Binary Search

    Stacks and queues keep data in a particular order; binary search finds an element in sorted data fast. Together they cover efficient handling and searching.

  4. 04 · 7 problems

    Trees and Binary Search Trees

    Trees are hierarchies of parent and child nodes. This is about traversing them, the depth of nodes, and how nodes relate to each other.

  5. 05 · 6 problems

    Graphs

    Graphs show how things relate, with nodes and edges. This covers traversals (BFS, DFS) and the relationships between nodes.

  6. 06 · 4 problems

    Recursion and Backtracking

    Recursion solves a problem by calling itself on smaller pieces. Backtracking tries options one by one, and steps back when it hits a dead end.

  7. 07 · 7 problems

    Dynamic Programming

    Dynamic programming stores the answers to subproblems that repeat, so nothing is computed twice and harder problems become fast.

  8. 08 · 4 problems

    Heaps, Greedy Algorithms and Intervals

    Choosing by priority, handling overlapping intervals, and picking the right option at each step: Top-K, scheduling and merging intervals.

How every problem is solved

Same nine stops for every problem, so you always know where you are.

  1. 01Understand the problemRestate it in your own words, with a tiny example.
  2. 02Brute force firstThe simplest thing that works, even if it's slow.
  3. 03See it in a diagramWatch the data move, step by step, before any code.
  4. 04Spot the patternName the trick, so you recognise it next time.
  5. 05The optimal solutionFix exactly what made brute force slow.
  6. 06Code in 6 languagesC++, Java, Python, JavaScript, Go and C#.
  7. 07Time and space complexityCount the steps and the memory, line by line.
  8. 08Edge cases and common mistakesEmpty input, duplicates, overflow: what breaks.
  9. 09Where it's used in real appsSpell check, Google Maps, bKash: the idea at work.
Start at the depot: Why Count Steps, Not Seconds →