Skip to main content
Harvard
Computer Science
4 credits

Harvard CS 124: Data Structures and Algorithms

CS 124 is Harvard's algorithms course, covering divide and conquer, greedy algorithms, dynamic programming, graph algorithms, hashing, and NP-completeness. It combines rigorous analysis with programming assignments, and it's a core theory requirement for CS concentrators and a known interview-prep powerhouse.

Fennie is independent and not affiliated with Harvard University. This is an unofficial study guide.

What makes it hard

The psets are the legend: multi-day problem sets where the hard problems require genuine insight, not pattern application. Dynamic programming and reductions are the conceptual peaks, and the course's expectation that you both prove correctness and implement efficiently doubles the workload relative to a pure-theory class.

What you'll cover

  • Divide and conquer and recurrences
  • Greedy algorithms
  • Dynamic programming
  • Graph algorithms and shortest paths
  • Hashing and randomized algorithms
  • NP-completeness and reductions

The CS 124 study guide

How to study for Harvard CS 124, step by step.

  1. 1

    Open every pset the day it's released

    CS 124's hard problems need marination, because insight arrives on the second or third spaced attempt, not in a single sitting. Read all the problems immediately so your brain can background-process them.

  2. 2

    Master each technique before its pset week

    Review divide and conquer, DP, or reductions before the relevant pset drops, working a few textbook problems cold. Learning a technique and applying it creatively in the same week is the overload that breaks people.

  3. 3

    Form a study group inside the collaboration policy

    Discussing approaches is allowed and invaluable; write-ups must be solo. Explaining your DP formulation to someone else is also the fastest way to find where it double-counts.

  4. 4

    Practice both halves: prove it and code it

    CS 124 grades correctness arguments and efficient implementations. For each algorithm you study, write the proof sketch and the code, because exams and psets demand the pairing.

Today

Today's CS 124 plan

Preview
65 min

What a Fennie Daily Plan looks like for CS 124. Yours is built from your own syllabus and adapts every day to your deadlines and progress.

0 / 4 done~65m remaining
Keep this plan free

First plan free, no card required. Fennie is independent and unaffiliated with your school.

FAQ

Is CS 124 hard?

It's one of the most demanding CS courses at Harvard. Psets routinely take 15+ hours and the hard problems require real creativity. It's also one of the most valuable for technical interviews.

What should I know before CS 124?

Comfort with proofs (discrete math at the level of CS 20 or strong math background), programming fluency, and basic data structures. Weak proof skills hurt more than weak coding here.

How do I survive CS 124 psets?

Start the day they're released and let hard problems sit overnight, since insight comes from spaced attempts. Form a study group within the collaboration policy, and write up solutions alone.

More Harvard courses