How long does it take to learn algorithms and data structures?
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
- Week 1Algorithms and computation (continued)
- Week 2Algorithms and computation
- Week 3Data structures and dynamic arrays (continued)
- Week 4Data structures and dynamic arraysReview weeks 1–3 from memory
- Week 5Sets and sorting (continued)
- Week 6Sets and sorting
- Week 7Hashing (continued)
- Week 8HashingReview weeks 5–7 from memory
- Week 9Linear sorting
- Week 10Binary trees (continued)
- Week 11Binary trees
- Week 12Balanced binary trees: AVL (continued)Review weeks 9–11 from memory
- Week 13Balanced binary trees: AVL
- Week 14Binary heaps (continued)
- Week 15Binary heaps
- Week 16Breadth-first search (continued)Review weeks 13–15 from memory
- Week 17Breadth-first search
- Week 18Depth-first search
- Week 19Weighted shortest paths (continued)
- Week 20Weighted shortest pathsReview weeks 17–19 from memory
- Week 21Bellman–Ford (continued)
- Week 22Bellman–Ford
- Week 23Dijkstra (continued)
- Week 24DijkstraReview weeks 21–23 from memory
- Week 25All-pairs shortest paths and Johnson (continued)
- Week 26All-pairs shortest paths and Johnson
- Week 27Dynamic programming: SRTBOT, Fibonacci, DAGs
- Week 28Dynamic programming: LCS, LIS, coins (continued)Review weeks 25–27 from memory
- Week 29Dynamic programming: LCS, LIS, coins
- Week 30Dynamic programming: APSP, parentheses, piano (continued)
- Week 31Dynamic programming: APSP, parentheses, piano
- Week 32Dynamic programming: subset sum, pseudopolynomial time (continued)Review weeks 29–31 from memory
- Week 33Dynamic programming: subset sum, pseudopolynomial time
- Week 34Complexity
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 betaHow 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
- MIT OpenCourseWare — 6.006 Introduction to Algorithms, Spring 2020 — topic order; materials CC BY-NC-SA 4.0, hosted by MIT
- MIT Course Catalog — 6.1210 — units and prerequisites
- MIT Registrar — Subject levels and credit — one MIT unit ≈ 14 hours of work per term