Educational Lab

How long does it take to learn algorithms and data structures?

Measured by MIT 6.1210 Introduction to Algorithms · updated
Short answer

About 168 hours of focused work. MIT budgets 12 units for 6.1210 Introduction to Algorithms, and one MIT unit is about 14 hours. That is 34 weeks at 5 hours a week, 21 weeks at 8 hours a week, or 14 weeks at 12 hours a week — MIT's own semester pace.

Hours
≈ 168
At 5 h / week
34 weeks
MIT units
12 (5-0-7)
Prerequisite
6.100A and Mathematics for Computer Science (6.1200)

What you will be able to do

By the end you can choose and analyze data structures, sorting, graph search, shortest paths and dynamic programming — the material of coding interviews. The plan below follows the topic order of 6.006 Introduction to Algorithms, Spring 2020, taught by Erik Demaine, Jason Ku and Justin Solomon — free on MIT OpenCourseWare, with lectures, problem sets and exams.

Your plan

Hours a week
Starting point
34 weeks
≈ 168 hours · 5 hours a week
  1. Week 1
    Algorithms and computation (continued)
  2. Week 2
    Algorithms and computation
  3. Week 3
    Data structures and dynamic arrays (continued)
  4. Week 4
    Data structures and dynamic arrays
    Review weeks 1–3 from memory
  5. Week 5
    Sets and sorting (continued)
  6. Week 6
    Sets and sorting
  7. Week 7
    Hashing (continued)
  8. Week 8
    Hashing
    Review weeks 5–7 from memory
  9. Week 9
    Linear sorting
  10. Week 10
    Binary trees (continued)
  11. Week 11
    Binary trees
  12. Week 12
    Balanced binary trees: AVL (continued)
    Review weeks 9–11 from memory
  13. Week 13
    Balanced binary trees: AVL
  14. Week 14
    Binary heaps (continued)
  15. Week 15
    Binary heaps
  16. Week 16
    Breadth-first search (continued)
    Review weeks 13–15 from memory
  17. Week 17
    Breadth-first search
  18. Week 18
    Depth-first search
  19. Week 19
    Weighted shortest paths (continued)
  20. Week 20
    Weighted shortest paths
    Review weeks 17–19 from memory
  21. Week 21
    Bellman–Ford (continued)
  22. Week 22
    Bellman–Ford
  23. Week 23
    Dijkstra (continued)
  24. Week 24
    Dijkstra
    Review weeks 21–23 from memory
  25. Week 25
    All-pairs shortest paths and Johnson (continued)
  26. Week 26
    All-pairs shortest paths and Johnson
  27. Week 27
    Dynamic programming: SRTBOT, Fibonacci, DAGs
  28. Week 28
    Dynamic programming: LCS, LIS, coins (continued)
    Review weeks 25–27 from memory
  29. Week 29
    Dynamic programming: LCS, LIS, coins
  30. Week 30
    Dynamic programming: APSP, parentheses, piano (continued)
  31. Week 31
    Dynamic programming: APSP, parentheses, piano
  32. Week 32
    Dynamic programming: subset sum, pseudopolynomial time (continued)
    Review weeks 29–31 from memory
  33. Week 33
    Dynamic programming: subset sum, pseudopolynomial time
  34. Week 34
    Complexity

A plan on paper is the easy part. Educational Lab runs it: Otto fits it into your week, a tutor teaches through recall, reviews bring topics back.

Start this plan — free beta

How we count the hours

MIT gives every subject a number of units, written as three numbers — class time, lab time and preparation. 6.1210 is 5-0-7, so 12 units. The MIT Registrar puts one unit at about 14 hours of work per term, which makes 168 hours: lectures, reading and problem sets together.

The starting point is our planning assumption, not an MIT figure: if you studied the subject before we count 75% of the hours, if you are only reviewing — 50%. Every fourth week brings back the three before it, because recalling a topic after a gap is what makes it stay.

Questions

How long does it take to learn data structures and algorithms?
MIT's Introduction to Algorithms (6.1210, published on OpenCourseWare as 6.006) is a 12-unit subject — about 168 hours of work, assuming you already program in Python and know discrete math.
Do I need math for algorithms?
MIT requires Mathematics for Computer Science (6.1200) — proofs, induction, asymptotics and basic probability — alongside introductory programming (6.100A). Without proofs, the analysis half of the course is hard to follow.
Is this enough for coding interviews?
The topics — hashing, sorting, trees, heaps, graph search, shortest paths and dynamic programming — are the core of most interview problem sets. Interviews add timed practice on top, which is a separate habit to plan for.

Sources

  1. MIT OpenCourseWare — 6.006 Introduction to Algorithms, Spring 2020 — topic order; materials CC BY-NC-SA 4.0, hosted by MIT
  2. MIT Course Catalog — 6.1210 — units and prerequisites
  3. MIT Registrar — Subject levels and credit — one MIT unit ≈ 14 hours of work per term

More study plans