DSA Factory
All free lessons
Level 5 · Interview mastery

Free Timed practice lessons

10 lessons, about 3 hours in all. Each teaches one idea with a visual, then gives you one problem built for it. Read the lessons here, then create a free account to practise and keep your progress.

Stage 0Timed set 1

  1. Joining two islandsFind the island you can already see, then grow outwards from all of it at once until you touch the other.14 min
  2. Longest mirror subsequenceThe longest palindrome you can make by deleting letters from a word.14 min
  3. Ladders or bricksWalk along buildings of different heights, climbing each rise with bricks or a ladder, and find the furthest you can get, by giving ladders to the biggest rises.20 min
  4. Watching every branchPlace the fewest cameras in a tree so that every node is watched, where a camera watches its parent, itself and its children, using three states per node.22 min
  5. Rain between the wallsWork out how much rain a row of walls can hold, filling layer by layer whenever a taller wall closes a dip.20 min

Stage 1Timed set 2

  1. A chain reactionBuild a one-way graph from distances, then search from every starting point to find the biggest chain.14 min
  2. Ring of housesRob houses around a circle with no two neighbours, where the first and last are neighbours too.12 min
  3. Insert operators to reach a targetPut plus, minus or times between the digits of a string, or nothing at all to join digits, to make an expression equal to a target, tracking the last term so that times is applied correctly.26 min
  4. The longest climbFind the length of the longest strictly increasing run of values (in order, not necessarily neighbours) by keeping the best tail for each length and searching it.18 min
  5. Pairs that fill up a kCount pairs whose sum is a multiple of k.12 min

All of Timed practice is free

That’s the whole topic, from the first idea to the mastery stage, with no card needed. Create a free account to practise, keep your progress and carry on to the next topic.

Create your free account